TEXT   20

htmlconvert conf

Guest on 14th August 2022 12:52:39 AM

  1. # ----------------------------------------------------------------------------
  2. # DISCUS HTML tag to formatting tag conversion
  3. #
  4. # This allows you to define those HTML patterns that you want to be converted
  5. # into formatting tags.  Here is how this file is parsed:
  6. #
  7. #   Lines starting with # are comments.
  8. #   Blank lines are ignored.
  9. #   Other lines are conversions to be performed, in the format:
  10. #      Command [spaces] Discus Formatting Tag [spaces] HTML start [spaces] HTML stop
  11. #
  12. # The command is one of the following:
  13. #   S = Regular smart matching
  14. #   O = Define order of elements for a tag
  15. #
  16. # Your Discus Formatting Tag can have NO spaces within it.  If you think about
  17. # it, you should not need any.  Within your formatting tag, use representations
  18. # such as $1, $2, etc., to refer to the first, second, etc., matches from the
  19. # regular expression.  And use $' for everything that comes after the match before
  20. # the closing tag.
  21. #
  22. # Adjustments are made for people using (or failing to use) quotes within tags.
  23. # Allowances are made for a different order of arguments from how you've defined
  24. # them here, provided that you use 'O' to define the order in which tag arguments
  25. # are defined in this file.
  26. #
  27. # This file is executed from top to bottom.  Thus, your expressions at the top should
  28. # be the more complicated expressions, working down to the least complicated at the
  29. # bottom of the file.
  30. #
  31. # User HTML is parsed from the inside out.
  32. #
  33. # Pattern matching is case-insensitive.
  34. # ----------------------------------------------------------------------------
  35.  
  36. #####################################################
  37. # Order of elements within particular HTML tags
  38.  
  39. O       N/A             font    face,color,size
  40. O       N/A             a               href,target
  41.  
  42. #####################################################
  43. # Font with face, color, and size
  44.  
  45. S       \font{$1,\rgb{$2,\2{$'}}}       <font face="([^"]+)" color="([^"]+)" size="\+2">        </font>
  46. S       \font{$1,\rgb{$2,\1{$'}}}       <font face="([^"]+)" color="([^"]+)" size="\+1">        </font>
  47. S       \font{$1,\rgb{$2,\0{$'}}}       <font face="([^"]+)" color="([^"]+)" size="\+0">        </font>
  48. S       \font{$1,\rgb{$2,\-1{$'}}}      <font face="([^"]+)" color="([^"]+)" size="\-1">        </font>
  49. S       \font{$1,\rgb{$2,\-2{$'}}}      <font face="([^"]+)" color="([^"]+)" size="\-2">        </font>
  50. S       \font{$1,\rgb{$2,\-2{$'}}}      <font face="([^"]+)" color="([^"]+)" size="1">          </font>
  51. S       \font{$1,\rgb{$2,\-1{$'}}}      <font face="([^"]+)" color="([^"]+)" size="2">          </font>
  52. S       \font{$1,\rgb{$2,\0{$'}}}       <font face="([^"]+)" color="([^"]+)" size="3">          </font>
  53. S       \font{$1,\rgb{$2,\1{$'}}}       <font face="([^"]+)" color="([^"]+)" size="4">          </font>
  54. S       \font{$1,\rgb{$2,\2{$'}}}       <font face="([^"]+)" color="([^"]+)" size="[567]">      </font>
  55. S       \font{$1,\rgb{$'}}                      <font face="([^"]+)" color="([^"]+)" size="[^"]+">      </font>
  56.  
  57. #####################################################
  58. # Font with face and size
  59.  
  60. S       \font{$1,\2{$'}}        <font face="([^"]+)" size="\+2">        </font>
  61. S       \font{$1,\1{$'}}        <font face="([^"]+)" size="\+1">        </font>
  62. S       \font{$1,\0{$'}}        <font face="([^"]+)" size="\+0">        </font>
  63. S       \font{$1,\-1{$'}}       <font face="([^"]+)" size="\-1">        </font>
  64. S       \font{$1,\-2{$'}}       <font face="([^"]+)" size="\-2">        </font>
  65. S       \font{$1,\-2{$'}}       <font face="([^"]+)" size="1">          </font>
  66. S       \font{$1,\-1{$'}}       <font face="([^"]+)" size="2">          </font>
  67. S       \font{$1,\0{$'}}        <font face="([^"]+)" size="3">          </font>
  68. S       \font{$1,\1{$'}}        <font face="([^"]+)" size="4">          </font>
  69. S       \font{$1,\2{$'}}        <font face="([^"]+)" size="[567]">      </font>
  70. S       \font{$1,$'}            <font face="([^"]+)" size="[^"]+">      </font>
  71.  
  72. #####################################################
  73. # Font with color and size
  74.  
  75. S       \rgb{$1,\2{$'}}         <font color="([^"]+)" size="\+2">       </font>
  76. S       \rgb{$1,\1{$'}}         <font color="([^"]+)" size="\+1">       </font>
  77. S       \rgb{$1,\0{$'}}         <font color="([^"]+)" size="\+0">       </font>
  78. S       \rgb{$1,\-1{$'}}        <font color="([^"]+)" size="\-1">       </font>
  79. S       \rgb{$1,\-2{$'}}        <font color="([^"]+)" size="\-2">       </font>
  80. S       \rgb{$1,\-2{$'}}        <font color="([^"]+)" size="1">         </font>
  81. S       \rgb{$1,\-1{$'}}        <font color="([^"]+)" size="2">         </font>
  82. S       \rgb{$1,\0{$'}}         <font color="([^"]+)" size="3">         </font>
  83. S       \rgb{$1,\1{$'}}         <font color="([^"]+)" size="4">         </font>
  84. S       \rgb{$1,\2{$'}}         <font color="([^"]+)" size="[567]">     </font>
  85. S       \rgb{$1,\2{$'}}         <font color="([^"]+)" size="[^"]+">     </font>
  86. S       \rgb{$1,$'}                     <font color="([^"]+)" size="[^"]+">     </font>
  87.  
  88. #####################################################
  89. # Font with color and size
  90.  
  91. S       \font{$1,\rgb{$2}}      <font face="([^"]+)" color="([^"]+)">   </font>
  92.  
  93. #####################################################
  94. # Font with size only
  95.  
  96. S       \2{$'}          <font size="\+2">       </font>
  97. S       \1{$'}          <font size="\+1">       </font>
  98. S       \0{$'}          <font size="\+0">       </font>
  99. S       \-1{$'}         <font size="\-1">       </font>
  100. S       \-2{$'}         <font size="\-2">       </font>
  101. S       \-2{$'}         <font size="1">         </font>
  102. S       \-1{$'}         <font size="2">         </font>
  103. S       \0{$'}          <font size="3">         </font>
  104. S       \1{$'}          <font size="4">         </font>
  105. S       \2{$'}          <font size="[567]">     </font>
  106. S       \0{$'}          <font size="[^"]+">     </font>
  107.  
  108. #####################################################
  109. # Font with color or face only
  110.  
  111. S       \font{$1,$'}    <font face="([^"]+)">   </font>
  112. S       \rgb{$1,$'}             <font color="([^"]+)">  </font>
  113.  
  114. #####################################################
  115. # Nearest equivalents of H1, H2, H3, H4, H5
  116.  
  117. S       \ch{br}\2{\b{$'}}\ch{br}        <h1>    </h1>
  118. S       \ch{br}\1{\b{$'}}\ch{br}        <h2>    </h2>
  119. S       \ch{br}\0{\b{$'}}\ch{br}        <h3>    </h3>
  120. S       \ch{br}\-1{\b{$'}}\ch{br}       <h4>    </h4>
  121. S       \ch{br}\-2{\b{$'}}\ch{br}       <h[567]>        </h[567]>
  122.  
  123. #####################################################
  124. # Hyperlinks
  125.  
  126. S       \newurl{$1,$'}          <a href="([^"]+)" target="_blank">      </a>
  127. S       \topurl{$1,$'}          <a href="([^"]+)" target="_top">        </a>
  128. S       \topurl{$1,$'}          <a href="([^"]+)" target="_parent">     </a>
  129. S       \newurl{$1,$'}          <a href="([^"]+)" target="_blank">      </a>
  130. S       \mail{$1,$'}            <a href="mailto:([^"]+)">                       </a>
  131. S       \link{$1,$'}            <a href="([^"]+)">                                      </a>
  132.  
  133. #####################################################
  134. # Other simple formatting
  135.  
  136. S       \b{$'}                  <b>                     </b>
  137. S       \i{$'}                  <i>                     </i>
  138. S       \c{$'}                  <c>                     </c>
  139. S       \c{$'}                  <center>        </center>
  140. S       \u{$'}                  <u>                     </u>
  141. S       \strike{$'}             <strike>        </strike>
  142. S       \blink{$'}              <blink>         </blink>
  143. S       \+{$'}                  <sup>           </sup>
  144. S       \-{$'}                  <sub>           </sub>
  145. S       \pre{$'}                <pre>           </pre>
  146.  
  147. #####################################################
  148. # Add "UBB code" if you want, but remember the backslash
  149. # before the square brackets!
  150.  
  151. #S      \b{$'}                  \[b\]                   \[/b\]
  152. S       \fixed{[\n]\*[\n]$'[\n]*\[\n]}  \[code\]        \[/code\]

Raw Paste


Login or Register to edit or fork this paste. It's free.