if (scratch->extensions & EXT_NO_LABELS) {
printf("<h%1d>", temp_short + scratch->base_header_level - 1);
} else {
- temp_char = label_from_token(source, t);
+ temp_token = manual_label_from_header(t, source);
+ if (temp_token) {
+ temp_char = label_from_token(source, temp_token);
+ } else {
+ temp_char = label_from_token(source, t);
+ }
printf("<h%1d id=\"%s\">", temp_short + scratch->base_header_level - 1, temp_char);
free(temp_char);
}
if (scratch->extensions & EXT_NO_LABELS) {
printf("<h%1d>", temp_short + scratch->base_header_level - 1);
} else {
- temp_char = label_from_token(source, t);
+ temp_token = manual_label_from_header(t, source);
+ if (temp_token) {
+ temp_char = label_from_token(source, temp_token);
+ } else {
+ temp_char = label_from_token(source, t);
+ }
printf("<h%1d id=\"%s\">", temp_short + scratch->base_header_level - 1, temp_char);
free(temp_char);
}
case BLOCK_H5:
case BLOCK_H6:
case BLOCK_PARA:
+ case BLOCK_SETEXT_1:
+ case BLOCK_SETEXT_2:
case BLOCK_TERM:
token_pairs_match_pairs_inside_token(block, e, s, 0);
break;
case BLOCK_LIST_ITEM:
case BLOCK_LIST_ITEM_TIGHT:
case BLOCK_PARA:
+ case BLOCK_SETEXT_1:
+ case BLOCK_SETEXT_2:
case BLOCK_TABLE:
case BLOCK_TERM:
// Assign child tokens of blocks
yymsp[0].minor.yy0 = yylhsminor.yy0;
break;
case 24: /* block ::= setext_1 */
-{ yylhsminor.yy0 = token_new_parent(yymsp[0].minor.yy0, BLOCK_SETEXT_1); }
+{ yylhsminor.yy0 = token_new_parent(yymsp[0].minor.yy0, BLOCK_SETEXT_1); if (!(engine->extensions & EXT_NO_LABELS)) stack_push(engine->header_stack, yylhsminor.yy0); }
yymsp[0].minor.yy0 = yylhsminor.yy0;
break;
case 25: /* block ::= setext_2 */
-{ yylhsminor.yy0 = token_new_parent(yymsp[0].minor.yy0, BLOCK_SETEXT_2); }
+{ yylhsminor.yy0 = token_new_parent(yymsp[0].minor.yy0, BLOCK_SETEXT_2); if (!(engine->extensions & EXT_NO_LABELS)) stack_push(engine->header_stack, yylhsminor.yy0); }
yymsp[0].minor.yy0 = yylhsminor.yy0;
break;
case 26: /* block ::= table */
block(A) ::= list_enum(B). { A = token_new_parent(B, BLOCK_LIST_ENUMERATED); is_list_loose(A); }
block(A) ::= meta_block(B). { A = token_new_parent(B, BLOCK_META); }
block(A) ::= para(B). { A = token_new_parent(B, BLOCK_PARA); is_para_html(engine, A); }
-block(A) ::= setext_1(B). { A = token_new_parent(B, BLOCK_SETEXT_1); }
-block(A) ::= setext_2(B). { A = token_new_parent(B, BLOCK_SETEXT_2); }
+block(A) ::= setext_1(B). { A = token_new_parent(B, BLOCK_SETEXT_1); if (!(engine->extensions & EXT_NO_LABELS)) stack_push(engine->header_stack, A); }
+block(A) ::= setext_2(B). { A = token_new_parent(B, BLOCK_SETEXT_2); if (!(engine->extensions & EXT_NO_LABELS)) stack_push(engine->header_stack, A); }
block(A) ::= table(B). { A = token_new_parent(B, BLOCK_TABLE); }
<h1 id="baz">foo <a href="#bat">bar</a></h1>
<p>5</p>
+
+<h1 id="bar">foo </h1>
<h1>foo [bar][bat][baz]</h1>
<p>5</p>
+
+<h1>foo [bar]</h1>
# foo [bar][bat][baz]
5
+
+foo [bar]
+=========
<h1 id="foobar">foo bar</h1>
-<h2 id="foobar">foo bar</h2>
+<h2 id="foobar">foo <em>bar</em></h2>
<h1 id="foobar">foo
bar</h1>
<h1>foo bar</h1>
-<h2>foo bar</h2>
+<h2>foo <em>bar</em></h2>
<h1>foo
bar</h1>
foo bar
=======
-foo bar
+foo *bar*
-------
foo