case HASH6:
print_token(t);
break;
+ case HTML_ENTITY:
+ print_token(t);
+ break;
case HTML_COMMENT_START:
if (!(scratch->extensions & EXT_SMART)) {
print_const("<!--");
print_const("\\");
mmd_print_char_html(out, source[t->start + 1], false);
break;
+ case HTML_ENTITY:
+ print_const("&");
+ d_string_append_c_array(out, &(source[t->start + 1]), t->len - 1);
+ break;
case MATH_BRACKET_OPEN:
print_const("\\[");
break;
ESCAPED_CHARACTER,
+ HTML_ENTITY,
HTML_COMMENT_START,
HTML_COMMENT_STOP,
PAIR_HTML_COMMENT,
}
}
break;
+ case HTML_ENTITY:
+ if (source[t->start + 1] == '#') {
+ print_const("\\&\\#");
+ d_string_append_c_array(out, &(source[t->start + 2]), t->len - 2);
+ } else {
+ print_const("\\");
+ print_token(t);
+ }
+ break;
case HTML_COMMENT_START:
if (!(scratch->extensions & EXT_SMART)) {
print_const("<!--");
print_char(source[t->start + 1]);
// mmd_print_char_latex(out, source[t->start + 1]);
break;
+ case HTML_ENTITY:
+ print_token(t);
+ break;
case CODE_FENCE:
if (t->next)
t->next->type = TEXT_EMPTY;
print_const("\\textbackslash{}");
mmd_print_char_latex(out, source[t->start + 1]);
break;
+ case HTML_ENTITY:
+ if (source[t->start + 1] == '#') {
+ print_const("\\&\\#");
+ d_string_append_c_array(out, &(source[t->start + 2]), t->len - 2);
+ } else {
+ print_const("\\");
+ print_token(t);
+ }
+ break;
case CODE_FENCE:
if (t->next)
t->next->type = TEXT_EMPTY;
-/* Generated by re2c 0.14.3 on Mon May 1 09:51:46 2017 */
+/* Generated by re2c 0.14.3 on Tue May 30 21:57:22 2017 */
/**
MultiMarkdown 6 -- Lightweight markup processor to produce HTML, LaTeX, and more.
case 14: goto yy128;
case 15: goto yy135;
case 16: goto yy145;
- default: goto yy286;
+ default: goto yy300;
}
yy3:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
switch (yych) {
- case '+': goto yy291;
- case '-': goto yy290;
- case '=': goto yy287;
- case '>': goto yy289;
- case '{': goto yy285;
- case '~': goto yy288;
+ case '+': goto yy305;
+ case '-': goto yy304;
+ case '=': goto yy301;
+ case '>': goto yy303;
+ case '{': goto yy299;
+ case '~': goto yy302;
default: goto yy4;
}
yy4:
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
switch (yych) {
- case '+': goto yy282;
+ case '+': goto yy296;
default: goto yy6;
}
yy6:
yy7:
++YYCURSOR;
switch ((yych = *YYCURSOR)) {
- case '-': goto yy274;
+ case '-': goto yy288;
default: goto yy8;
}
yy8:
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
switch (yych) {
- case '!': goto yy267;
- case '<': goto yy268;
+ case '!': goto yy281;
+ case '<': goto yy282;
default: goto yy10;
}
yy10:
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
switch (yych) {
- case '>': goto yy263;
- case '~': goto yy262;
+ case '>': goto yy277;
+ case '~': goto yy276;
default: goto yy12;
}
yy12:
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
switch (yych) {
- case '=': goto yy259;
+ case '=': goto yy273;
default: goto yy14;
}
yy14:
yy15:
++YYCURSOR;
switch ((yych = *YYCURSOR)) {
- case '#': goto yy255;
- case '%': goto yy249;
- case '>': goto yy257;
- case '?': goto yy251;
- case '^': goto yy253;
+ case '#': goto yy269;
+ case '%': goto yy263;
+ case '>': goto yy271;
+ case '?': goto yy265;
+ case '^': goto yy267;
default: goto yy16;
}
yy16:
yy19:
++YYCURSOR;
switch ((yych = *YYCURSOR)) {
- case '[': goto yy247;
+ case '[': goto yy261;
default: goto yy20;
}
yy20:
yy27:
++YYCURSOR;
switch ((yych = *YYCURSOR)) {
- case '}': goto yy245;
+ case '}': goto yy259;
default: goto yy28;
}
yy28:
yy31:
++YYCURSOR;
switch ((yych = *YYCURSOR)) {
- case '\'': goto yy243;
+ case '\'': goto yy257;
default: goto yy32;
}
yy32:
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
switch (yych) {
- case ' ': goto yy235;
- case '.': goto yy236;
+ case ' ': goto yy249;
+ case '.': goto yy250;
default: goto yy20;
}
yy34:
yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
switch (yych) {
+ case '#': goto yy233;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy230;
case 'A':
- case 'a': goto yy230;
+ case 'a': goto yy232;
default: goto yy37;
}
yy37:
++YYCURSOR;
{ return MATH_BRACKET_CLOSE; }
yy230:
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+yy231:
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy230;
+ case ';': goto yy244;
+ default: goto yy2;
+ }
+yy232:
yych = *++YYCURSOR;
switch (yych) {
case 'M':
- case 'm': goto yy231;
+ case 'm': goto yy243;
+ default: goto yy231;
+ }
+yy233:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy235;
+ case 'X':
+ case 'x': goto yy234;
default: goto yy2;
}
-yy231:
+yy234:
yych = *++YYCURSOR;
switch (yych) {
+ case ';': goto yy2;
+ default: goto yy240;
+ }
+yy235:
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy235;
+ case ';': goto yy237;
+ default: goto yy2;
+ }
+yy237:
+ ++YYCURSOR;
+ { return HTML_ENTITY; }
+yy239:
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+yy240:
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
case 'P':
- case 'p': goto yy232;
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '[':
+ case '\\':
+ case ']':
+ case '^':
+ case '_':
+ case '`':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f': goto yy239;
+ case ';': goto yy241;
default: goto yy2;
}
-yy232:
+yy241:
+ ++YYCURSOR;
+ { return HTML_ENTITY; }
+yy243:
yych = *++YYCURSOR;
switch (yych) {
- case ';': goto yy233;
- default: goto yy2;
+ case 'P':
+ case 'p': goto yy246;
+ default: goto yy231;
}
-yy233:
+yy244:
+ ++YYCURSOR;
+ { return HTML_ENTITY; }
+yy246:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case ';': goto yy247;
+ default: goto yy231;
+ }
+yy247:
++YYCURSOR;
{ return AMPERSAND_LONG; }
-yy235:
+yy249:
yych = *++YYCURSOR;
switch (yych) {
- case '.': goto yy239;
+ case '.': goto yy253;
default: goto yy2;
}
-yy236:
+yy250:
yych = *++YYCURSOR;
switch (yych) {
- case '.': goto yy237;
+ case '.': goto yy251;
default: goto yy2;
}
-yy237:
+yy251:
++YYCURSOR;
{ return ELLIPSIS; }
-yy239:
+yy253:
yych = *++YYCURSOR;
switch (yych) {
- case ' ': goto yy240;
+ case ' ': goto yy254;
default: goto yy2;
}
-yy240:
+yy254:
yych = *++YYCURSOR;
switch (yych) {
- case '.': goto yy241;
+ case '.': goto yy255;
default: goto yy2;
}
-yy241:
+yy255:
++YYCURSOR;
{ return ELLIPSIS; }
-yy243:
+yy257:
++YYCURSOR;
{ return QUOTE_RIGHT_ALT; }
-yy245:
+yy259:
++YYCURSOR;
{ return BRACE_DOUBLE_RIGHT; }
-yy247:
+yy261:
++YYCURSOR;
{ return BRACKET_IMAGE_LEFT; }
-yy249:
+yy263:
++YYCURSOR;
{ return BRACKET_VARIABLE_LEFT; }
-yy251:
+yy265:
++YYCURSOR;
{ return BRACKET_GLOSSARY_LEFT; }
-yy253:
+yy267:
++YYCURSOR;
{ return BRACKET_FOOTNOTE_LEFT; }
-yy255:
+yy269:
++YYCURSOR;
{ return BRACKET_CITATION_LEFT; }
-yy257:
+yy271:
++YYCURSOR;
{ return BRACKET_ABBREVIATION_LEFT; }
-yy259:
+yy273:
yych = *++YYCURSOR;
switch (yych) {
- case '}': goto yy260;
+ case '}': goto yy274;
default: goto yy2;
}
-yy260:
+yy274:
++YYCURSOR;
{ return CRITIC_HI_CLOSE; }
-yy262:
+yy276:
yych = *++YYCURSOR;
switch (yych) {
- case '}': goto yy265;
+ case '}': goto yy279;
default: goto yy2;
}
-yy263:
+yy277:
++YYCURSOR;
{ return CRITIC_SUB_DIV; }
-yy265:
+yy279:
++YYCURSOR;
{ return CRITIC_SUB_CLOSE; }
-yy267:
+yy281:
yych = *++YYCURSOR;
switch (yych) {
- case '-': goto yy271;
+ case '-': goto yy285;
default: goto yy2;
}
-yy268:
+yy282:
yych = *++YYCURSOR;
switch (yych) {
- case '}': goto yy269;
+ case '}': goto yy283;
default: goto yy2;
}
-yy269:
+yy283:
++YYCURSOR;
{ return CRITIC_COM_CLOSE; }
-yy271:
+yy285:
yych = *++YYCURSOR;
switch (yych) {
- case '-': goto yy272;
+ case '-': goto yy286;
default: goto yy2;
}
-yy272:
+yy286:
++YYCURSOR;
{ return HTML_COMMENT_START; }
-yy274:
+yy288:
++YYCURSOR;
switch ((yych = *YYCURSOR)) {
- case '-': goto yy280;
- case '>': goto yy278;
- case '}': goto yy276;
- default: goto yy275;
+ case '-': goto yy294;
+ case '>': goto yy292;
+ case '}': goto yy290;
+ default: goto yy289;
}
-yy275:
+yy289:
{ return DASH_N; }
-yy276:
+yy290:
++YYCURSOR;
{ return CRITIC_DEL_CLOSE; }
-yy278:
+yy292:
++YYCURSOR;
{ return HTML_COMMENT_STOP; }
-yy280:
+yy294:
++YYCURSOR;
{ return DASH_M; }
-yy282:
+yy296:
yych = *++YYCURSOR;
switch (yych) {
- case '}': goto yy283;
+ case '}': goto yy297;
default: goto yy2;
}
-yy283:
+yy297:
++YYCURSOR;
{ return CRITIC_ADD_CLOSE; }
-yy285:
+yy299:
yyaccept = 17;
yych = *(YYMARKER = ++YYCURSOR);
switch (yych) {
- case 'T': goto yy302;
- default: goto yy286;
+ case 'T': goto yy316;
+ default: goto yy300;
}
-yy286:
+yy300:
{ return BRACE_DOUBLE_LEFT; }
-yy287:
+yy301:
yych = *++YYCURSOR;
switch (yych) {
- case '=': goto yy300;
+ case '=': goto yy314;
default: goto yy2;
}
-yy288:
+yy302:
yych = *++YYCURSOR;
switch (yych) {
- case '~': goto yy298;
+ case '~': goto yy312;
default: goto yy2;
}
-yy289:
+yy303:
yych = *++YYCURSOR;
switch (yych) {
- case '>': goto yy296;
+ case '>': goto yy310;
default: goto yy2;
}
-yy290:
+yy304:
yych = *++YYCURSOR;
switch (yych) {
- case '-': goto yy294;
+ case '-': goto yy308;
default: goto yy2;
}
-yy291:
+yy305:
yych = *++YYCURSOR;
switch (yych) {
- case '+': goto yy292;
+ case '+': goto yy306;
default: goto yy2;
}
-yy292:
+yy306:
++YYCURSOR;
{ return CRITIC_ADD_OPEN; }
-yy294:
+yy308:
++YYCURSOR;
{ return CRITIC_DEL_OPEN; }
-yy296:
+yy310:
++YYCURSOR;
{ return CRITIC_COM_OPEN; }
-yy298:
+yy312:
++YYCURSOR;
{ return CRITIC_SUB_OPEN; }
-yy300:
+yy314:
++YYCURSOR;
{ return CRITIC_HI_OPEN; }
-yy302:
+yy316:
yych = *++YYCURSOR;
switch (yych) {
- case 'O': goto yy303;
+ case 'O': goto yy317;
default: goto yy2;
}
-yy303:
+yy317:
yych = *++YYCURSOR;
switch (yych) {
- case 'C': goto yy304;
+ case 'C': goto yy318;
default: goto yy2;
}
-yy304:
+yy318:
yych = *++YYCURSOR;
switch (yych) {
- case '}': goto yy305;
+ case '}': goto yy319;
default: goto yy2;
}
-yy305:
+yy319:
yych = *++YYCURSOR;
switch (yych) {
- case '}': goto yy306;
+ case '}': goto yy320;
default: goto yy2;
}
-yy306:
+yy320:
++YYCURSOR;
{ return TOC; }
}
"..." { return ELLIPSIS; }
". . ." { return ELLIPSIS; }
":" { return COLON; }
+
'&' { return AMPERSAND_LONG; }
+ "&#" [Xx] [0-9a-fA-f]+ ';' { return HTML_ENTITY; }
+ "&#" [0-9]+ ';' { return HTML_ENTITY; }
+ "&" [A-Za-z0-9]+ ';' { return HTML_ENTITY; }
"&" { return AMPERSAND; }
"/" { return SLASH; }
case HASH6:
print_token(t);
break;
+ case HTML_ENTITY:
+ print_const("&");
+ d_string_append_c_array(out, &(source[t->start + 1]), t->len - 1);
+ break;
case HTML_COMMENT_START:
if (!(scratch->extensions & EXT_SMART)) {
print_const("<!--");
print_const("\\");
mmd_print_char_odf(out, source[t->start + 1]);
break;
+ case HTML_ENTITY:
+ print_const("&");
+ d_string_append_c_array(out, &(source[t->start + 1]), t->len - 1);
+ break;
case INDENT_TAB:
print_const("<text:tab/>");
break;
<text:p text:style-name="Preformatted Text">& and &amp; and < and > in code block.<text:line-break/></text:p>
<text:p text:style-name="Standard">10</text:p>
+
+<text:p text:style-name="Standard">&copy; <text:span text:style-name="Source_20_Text">&copy;</text:span></text:p>
+
+<text:p text:style-name="Standard">&#169; <text:span text:style-name="Source_20_Text">&#169;</text:span></text:p>
+
+<text:p text:style-name="Standard">&#xA9; <text:span text:style-name="Source_20_Text">&#xA9;</text:span></text:p>
</office:text>
</office:body>
</office:document>
<p>10</p>
+<p>© <code>&copy;</code></p>
+
+<p>© <code>&#169;</code></p>
+
+<p>© <code>&#xA9;</code></p>
+
</body>
</html>
</code></pre>
<p>10</p>
+
+<p>© <code>&copy;</code></p>
+
+<p>© <code>&#169;</code></p>
+
+<p>© <code>&#xA9;</code></p>
10
+\© \texttt{\©}
+
+\&\#169; \texttt{\&\#169;}
+
+\&\#xA9; \texttt{\&\#xA9;}
+
\input{mmd6-article-footer}
\end{document}
[1]: http://example.com/?foo=1&bar=2
[2]: http://att.com/ "AT&T"
+
+© `©`
+
+© `©`
+
+© `©`