aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-01-29 21:18:07 +0000
committerJohn Ankarström <john@ankarstrom.se>2021-01-29 21:18:07 +0000
commita9b6311209593b5a5955048e124fc45a9d4a108e (patch)
tree7b9c7bceb311b0b53b211eda2218565f2a21420d
parenta27e58ed6acc8e9719bd8ed7c226d2734ff7a654 (diff)
downloadem-a9b6311209593b5a5955048e124fc45a9d4a108e.tar.gz
Fix lists
Apparently I removed "open" from every "openblock"? How?
-rw-r--r--README.html44
-rwxr-xr-xaux/emparse38
2 files changed, 42 insertions, 40 deletions
diff --git a/README.html b/README.html
index 2dea2c7..6da061c 100644
--- a/README.html
+++ b/README.html
@@ -5,12 +5,13 @@ Em is a limited hypertext markup language.
It is similar to Markdown, but it has a few key advantages:
</p>
<ol>
- 1. It is more readable.
- 2. It is simpler to parse.
- 3. There is *not* more than one way to do it (sorry Larry).
+<li value="1">It is more readable.
+</li><li value="2">It is simpler to parse.
+</li><li value="3">There is <i>not</i> more than one way to do it (sorry Larry).
+</li>
</ol>
<p>
-Em takes plain-text readability seriously. You should be able to
+Em takes plain-text readability seriously. You should be able to
write em in a plain-text e-mail message without the recipient noticing.
</p>
<p>
@@ -20,17 +21,17 @@ for the benefits of em.
<h2>Syntax</h2>
<h3>Block-level formatting</h3>
<p>
-*A single empty line* always marks a block break. There is
-no exception to this rule. The line is removed in the final output.
+<i>A single empty line</i> always marks a block break. There is
+no exception to this rule. The line is removed in the final output.
</p>
<p>
All blocks support inline formatting, except headings,
preformatted blocks and terms in definition lists.
</p>
<p>
-One block cannot be put within another block. For example,
+One block cannot be put within another block. For example,
it is impossible to put a paragraph or a preformatted block
-inside a list item. If you want paragraph lists, just use paragraphs:
+inside a list item. If you want paragraph lists, just use paragraphs:
</p>
<pre>
1. Lorem ipsum dolor sit amet, consectetur adipiscing elit,
@@ -52,7 +53,7 @@ Headings begin and end with the same number of equal signs:
</pre>
<h4>Lists</h4>
<p>
-Lists start with a single space. There are four types of lists:
+Lists start with a single space. There are four types of lists:
</p>
<pre>
- This is an unordered list
@@ -69,7 +70,7 @@ two lines
[2] With two items
</pre>
<p>
-Unordered and ordered lists can be nested. An additional space
+Unordered and ordered lists can be nested. An additional space
at the beginning of the line increases the item level by one:
</p>
<pre>
@@ -78,7 +79,7 @@ at the beginning of the line increases the item level by one:
- First level
</pre>
<p>
-A reference list is a special type of list, unique to em. It is a
+A reference list is a special type of list, unique to em. It is a
type of footnote list, to which you can make inline referencess
like this:
</p>
@@ -86,8 +87,8 @@ like this:
See footnote [1].
</pre>
<p>
-There is a special type of reference list item called a *hyperlink
-reference*. It contains only a single word, without whitespace:
+There is a special type of reference list item called a <i>hyperlink
+reference</i>. It contains only a single word, without whitespace:
</p>
<pre>
[1] http://example.com
@@ -120,7 +121,7 @@ This is another paragraph.
</pre>
<h3>Inline formatting</h3>
<p>
-_Italic, bold and teletype text_ is marked with the asterisk,
+<b>Italic, bold and teletype text</b> is marked with the asterisk,
the underscore and the backtick, respectively:
</p>
<pre>
@@ -130,13 +131,14 @@ Example of *italic* text.
The marks are only valid in certain positions:
</p>
<ol>
- 1. At word borders
- 2. After an opening parenthesis
- 3. Before any of `.,:;?!)`
- 4. Before a closing parenthesis any of `.,:;?!`
+<li value="1">At word borders
+</li><li value="2">After an opening parenthesis
+</li><li value="3">Before any of <tt>.,:;?!)</tt>
+</li><li value="4">Before a closing parenthesis any of <tt>.,:;?!</tt>
+</li>
</ol>
<p>
-_Inline references_ are created with square brackets:
+<b>Inline references</b> are created with square brackets:
</p>
<pre>
Example of an inline reference [12].
@@ -146,7 +148,7 @@ They are valid in positions 1, 3 and 4.
</p>
<p>
When referencing a hyperlink reference (see above),
-the reference is replaced with a link. For example:
+the reference is replaced with a link. For example:
</p>
<pre>
It is available for download [1].
@@ -162,5 +164,5 @@ translates into the following HTML:
</pre>
<p>
The default link text ("link") can be changed by setting
-the `linktext` environment variable.
+the <tt>linktext</tt> environment variable.
</p>
diff --git a/aux/emparse b/aux/emparse
index 38bec54..73fdd5c 100755
--- a/aux/emparse
+++ b/aux/emparse
@@ -158,7 +158,7 @@ END { breakblock() }
/^$/ { breakblock(); getline }
expectblock && /^ / { newblock("table") }
expectblock && /^ - / { newblock("ul") }
-expectblock && /^ [0-9a-z]+\. / { newblock("ol") }
+expectblock && /^ [0-9a-z]+\. / { newblock("ol") }
expectblock && /^ \[[0-9a-z]\]+ / { newblock("nl") }
expectblock && /^ .*: / { newblock("dl") }
expectblock && /^ / { newblock("pre") }
@@ -171,23 +171,23 @@ expectblock && /^===== .* =====$/ { heading(5, $0); next }
expectblock && /^====== .* ======$/ { heading(6, $0); next }
expectblock { newblock("p") }
-block = "pre" { sub("^ ", ""); escape(); printf "%s\n", $0; next }
-
-block = "ul" && /^ - / { item(1, "ul", line) }
-block = "ol" && /^ [0-9a-z]+\. / { item(1, "ol", line) }
-block = "nl" && /^ \[[0-9a-z]\]+ [^ ]+$/ { next } # hyperlink reference
-block = "nl" && /^ \[[0-9a-z]\]+ / { item(1, "nl", line) } # text reference
-block = "dl" && /^ .*: / { term(line) }
-
-block = "ul" && /^ -/ { item(2, "ul", line) }
-block = "ol" && /^ [0-9a-z]+\./ { item(2, "ol", line) }
-block = "ul" && /^ -/ { item(3, "ul", line) }
-block = "ol" && /^ [0-9a-z]+\./ { item(3, "ol", line) }
-block = "ul" && /^ -/ { item(4, "ul", line) }
-block = "ol" && /^ [0-9a-z]+\./ { item(4, "ol", line) }
-block = "ul" && /^ -/ { item(5, "ul", line) }
-block = "ol" && /^ [0-9a-z]+\./ { item(5, "ol", line) }
-block = "ul" && /^ -/ { item(6, "ul", line) }
-block = "ol" && /^ [0-9a-z]+\./ { item(6, "ol", line) }
+openblock == "pre" { sub("^ ", ""); escape(); printf "%s\n", $0; next }
+
+openblock == "ul" && /^ - / { item(1, "ul", line) }
+openblock == "ol" && /^ [0-9a-z]+\. / { item(1, "ol", line) }
+openblock == "nl" && /^ \[[0-9a-z]\]+ [^ ]+$/ { next } # hyperlink reference
+openblock == "nl" && /^ \[[0-9a-z]\]+ / { item(1, "nl", line) } # text reference
+openblock == "dl" && /^ .*: / { term(line) }
+
+openblock == "ul" && /^ -/ { item(2, "ul", line) }
+openblock == "ol" && /^ [0-9a-z]+\./ { item(2, "ol", line) }
+openblock == "ul" && /^ -/ { item(3, "ul", line) }
+openblock == "ol" && /^ [0-9a-z]+\./ { item(3, "ol", line) }
+openblock == "ul" && /^ -/ { item(4, "ul", line) }
+openblock == "ol" && /^ [0-9a-z]+\./ { item(4, "ol", line) }
+openblock == "ul" && /^ -/ { item(5, "ul", line) }
+openblock == "ol" && /^ [0-9a-z]+\./ { item(5, "ol", line) }
+openblock == "ul" && /^ -/ { item(6, "ul", line) }
+openblock == "ol" && /^ [0-9a-z]+\./ { item(6, "ol", line) }
{ format($0) }