History

Code and paragraphs inside blocks

yiyus committed 17 years ago

Commit fec811b1 parent 871822c1 file · +14 −10Browse files

Unified · Split

md2html.awk+14−10
@@ -92,15 +92,6 @@ BEGIN { · 91 unmodified lines
92 $0 = $0 "</tr>";92 $0 = $0 "</tr>";
93}93}
94 94
95# Code blocks
96/^( | )/ {
97 if(block != "code")
98 newblock("code");
99 sub(/^( | )/, "");
100 text = text $0 "\n";
101 next;
102}
103
104# Paragraph95# Paragraph
105/^$/{96/^$/{
106 newblock();97 newblock();
@@ -127,7 +118,20 @@ BEGIN { · 20 unmodified lines
127 }118 }
128 sub(/^([*+-]|(([0-9]+[\.-]?)+))[ ]/,"");119 sub(/^([*+-]|(([0-9]+[\.-]?)+))[ ]/,"");
129}120}
130nl > 0 { sub("^( ? ?| )","");}121{
122 for(i = 0; i < nl; i++)
123 sub("^( ? ?| )","");
124}
125/^$/ { text = "<p>" text "</p>";
126
127# Code blocks
128/^( | )/ && block != "li" {
129 if(block != "code")
130 newblock("code");
131 sub(/^( | )/, "");
132 text = text $0 "\n";
133 next;
134}
131 135
132# Setex-style Headers136# Setex-style Headers
133# (Plus h3 with underscores.)137# (Plus h3 with underscores.)