1.01.2 Coded Text Syntax - andperry256/my-base-theme-and-dbadmin Wiki

The function coded_text_to_html was created in response to a request for the ability to maintain the text of a web page in a simple text file without the requirement to log on to the WordPress Dashboard. This function would typically be called from a custom PHP script for the given page. It takes a single parameter containing the URL of the text file. The text is then interpreted using the syntax rules in the table below and the resulting HTML code returned as a string.

#*#<Text>#*# H1 Header
##<Text>## H2 Header
###<Text>### H3 Header
####<Text>#### H4 Header
**<Text>** Bold
///<Text>/// Italic (uses a triple slash because a double slash is commonly used in hyperlink addresses)
__<Text>__ Underline (the underscores at each end are double)
@@<Link Address>@@<Link Text>@@ Hyperlink (same tab/window)
@@<Link Address>@@@<Link Text>@@ Hyperlink (new tab/window)
#BL# Start of bulleted list
#*BL# End of bulleted list
#NL# Start of numbered list
#*NL# End of numbered list
* New list item (when at start of line inside a list)
<Blank Line> Create paragraph break (unless in a list)
\ Escape character to override other syntax (see note below)
Notes:
  • To achieve any formatting not covered by the above syntax rules, standard HTML tags can be included in the text.
  • Lists can be nested.
  • The backslash is used as an escape character, which means that the next character is taken 'as is'. In using the escape sequence, it is important to break up any character sequences that would otherwise be interpreted as syntax, as the syntax is processed first. So for example to create a double askterisk ** the text must be inserted as *\* and not \**.
⚠️ **GitHub.com Fallback** ⚠️