--- a/editing.html Wed Aug 17 14:36:07 2011 -0600
+++ b/editing.html Wed Aug 17 14:44:17 2011 -0600
@@ -239,9 +239,10 @@
was actually modified.
<li>But if we are already changing around something's style, convert existing
- styles to the preferred format. For instance, we use <code title=""><b></code> for bold (if the CSS styling flag is false), and convert
- <code title=""><strong></code> and <code title=""><span style="font-weight:
- bold"></code> if we happen to be modifying that node anyway.
+ styles to the preferred format. For instance, we use <code title=""><b></code> for bold
+ (if the CSS styling flag is false), and convert <code title=""><strong></code> and
+ <code title=""><span style="font-weight: bold"></code> if we happen to be modifying
+ that node anyway.
<li>Try not to make the document less conforming than it originally was. If
we happen to make it more conforming, good, although we don't have to go out
--- a/preprocess Wed Aug 17 14:36:07 2011 -0600
+++ b/preprocess Wed Aug 17 14:44:17 2011 -0600
@@ -152,6 +152,17 @@
if "[[" in s:
raise Exception("Unrecognized macro: " + s[s.find("[["):s.find("]]") + 2])
+# {{code|<foo>}} -> <code title><foo></code>. Also, to avoid things like
+# {{code|<b>}} messing up syntax highlighting, {{code<|b>}} is also supported
+# with the same effect as {{code|<b>}}.
+def codesub(matchobj):
+ return "<code title>" \
+ + matchobj.group(1).replace("<", "<") \
+ + matchobj.group(2).replace("&", "&").replace("<", "<") \
+ + "</code>"
+
+s = re.sub(r"\{\{code(<?)\|(.*?)\}\}", codesub, s)
+
s = s.replace("<var>", "<var title>")
s = s.replace("<!-- @{ -->", "")
--- a/source.html Wed Aug 17 14:36:07 2011 -0600
+++ b/source.html Wed Aug 17 14:44:17 2011 -0600
@@ -162,10 +162,10 @@
was actually modified.
<li>But if we are already changing around something's style, convert existing
- styles to the preferred format. For instance, we use <code
- title><b></code> for bold (if the CSS styling flag is false), and convert
- <code title><strong></code> and <code title><span style="font-weight:
- bold"></code> if we happen to be modifying that node anyway.
+ styles to the preferred format. For instance, we use {{code<|b>}} for bold
+ (if the CSS styling flag is false), and convert {{code<|strong>}} and
+ {{code|<span style="font-weight: bold">}} if we happen to be modifying
+ that node anyway.
<li>Try not to make the document less conforming than it originally was. If
we happen to make it more conforming, good, although we don't have to go out