diff --git a/ext/dtext/dtext.cpp.rl b/ext/dtext/dtext.cpp.rl index da96c02..34407d8 100644 --- a/ext/dtext/dtext.cpp.rl +++ b/ext/dtext/dtext.cpp.rl @@ -838,7 +838,7 @@ void StateMachine::append_section(const std::string_view summary, bool initially if (!summary.empty()) { append_html_escaped(summary); } - append_block(""); + append_block("
"); } void StateMachine::append_closing_p() { @@ -905,7 +905,7 @@ void StateMachine::dstack_rewind() { case INLINE_SPOILER: append(""); break; case BLOCK_SPOILER: append_block("
"); break; case BLOCK_QUOTE: append_block(""); break; - case BLOCK_SECTION: append_block(""); break; + case BLOCK_SECTION: append_block(""); break; case BLOCK_CODE: append_block(""); break; case BLOCK_TD: append_block(""); break; case BLOCK_TH: append_block(""); break; diff --git a/test/dtext_test.rb b/test/dtext_test.rb index d1ca3fa..75f00d6 100644 --- a/test/dtext_test.rb +++ b/test/dtext_test.rb @@ -245,7 +245,7 @@ test2[/ltable] assert_parse('

foo

', "[quote][quote]foo[/quote]") assert_parse('

foo

', "[quote][spoiler]foo[/quote]") assert_parse('
foo[/quote]
', "[quote][code]foo[/quote]") - assert_parse('

foo

', "[quote][section]foo[/quote]") + assert_parse('

foo

', "[quote][section]foo[/quote]") assert_parse('
foo
', "[quote][table][td]foo[/quote]") assert_parse('
', "[quote]* foo[/quote]") assert_parse('

foo

', "[quote]h1. foo[/quote]") @@ -258,13 +258,13 @@ test2[/ltable] def test_quote_blocks_nested_spoiler assert_parse("

a
blah
c

", "[quote]\na\n[spoiler]blah[/spoiler]\nc[/quote]") assert_parse("

a

blah

c

", "[quote]\na\n\n[spoiler]blah[/spoiler]\n\nc[/quote]") - assert_parse('
', "[section]\n[spoiler]\n* blah\n[/spoiler]\n[/section]") + assert_parse('
  • blah
', "[section]\n[spoiler]\n* blah\n[/spoiler]\n[/section]") - assert_parse('
', "[section]\n[spoiler]\n* blah\n[/spoiler]\n[/section]") + assert_parse('
  • blah
', "[section]\n[spoiler]\n* blah\n[/spoiler]\n[/section]") end def test_quote_blocks_nested_expand - assert_parse("

a

b

c

", "[quote]\na\n[section]\nb\n[/section]\nc\n[/quote]") + assert_parse("

a

b

c

", "[quote]\na\n[section]\nb\n[/section]\nc\n[/quote]") end def test_code @@ -402,10 +402,10 @@ test2[/ltable] # assert_parse('

a

d

', "a\n[spoilers]\n* b\n* c\n[/spoilers]\nd") assert_parse('

a

d

', "a\n[quote]\n* b\n* c\n[/quote]\nd") - assert_parse('

a

d

', "a\n[section]\n* b\n* c\n[/section]\nd") + assert_parse('

a

d

', "a\n[section]\n* b\n* c\n[/section]\nd") assert_parse('

a

d

', "a\n[quote]\n* b\n* c\n\nd") - assert_parse('

a

d

', "a\n[section]\n* b\n* c\n\nd") + assert_parse('

a

d

', "a\n[section]\n* b\n* c\n\nd") assert_parse('

*

', "*") assert_parse('

*a

', "*a") @@ -508,48 +508,48 @@ test2[/ltable] end def test_expand - assert_parse("

hello world

", "[section]hello world[/section]") + assert_parse("

hello world

", "[section]hello world[/section]") - assert_parse("

inline foo

blah blah

", "inline [i]foo [section]blah blah[/section]") - assert_parse('

inline foo

blah blah

', "inline [spoiler]foo [section]blah blah[/section]") + assert_parse("

inline foo

blah blah

", "inline [i]foo [section]blah blah[/section]") + assert_parse('

inline foo

blah blah

', "inline [spoiler]foo [section]blah blah[/section]") - assert_parse("

inline foo

blah blah

", "inline [i]foo\n\n[section]blah blah[/section]") - assert_parse('

inline foo

blah blah

', "inline [spoiler]foo\n\n[section]blah blah[/section]") + assert_parse("

inline foo

blah blah

", "inline [i]foo\n\n[section]blah blah[/section]") + assert_parse('

inline foo

blah blah

', "inline [spoiler]foo\n\n[section]blah blah[/section]") - assert_parse("

inline

blah blah

", "inline [section]blah blah[/section]") + assert_parse("

inline

blah blah

", "inline [section]blah blah[/section]") - assert_parse('

test

', "[section]\ntest\n[/section] ") - assert_parse('

test

blah

', "[section]\ntest\n[/section] blah") - assert_parse('

test

blah

', "[section]\ntest\n[/section] \nblah") - assert_parse('

test

blah

', "[section]\ntest\n[/section]\nblah") - assert_parse('

test

blah

', "[section]\ntest\n[/section]\n blah") # XXX should ignore space + assert_parse('

test

', "[section]\ntest\n[/section] ") + assert_parse('

test

blah

', "[section]\ntest\n[/section] blah") + assert_parse('

test

blah

', "[section]\ntest\n[/section] \nblah") + assert_parse('

test

blah

', "[section]\ntest\n[/section]\nblah") + assert_parse('

test

blah

', "[section]\ntest\n[/section]\n blah") # XXX should ignore space assert_parse("

[/section]

", "[/section]") assert_parse("

foo [/section] bar

", "foo [/section] bar") assert_parse('

test
[/section] blah

', "test\n[/section] blah") assert_parse('

test
[/section]

', "test\n[/section]\n* blah") - assert_parse('

test

See also

', "[section]\ntest\n[/section]\nh4. See also") - assert_parse('

test

blah

', "[section]\ntest\n[/section]\n[spoiler]blah[/spoiler]") + assert_parse('

test

See also

', "[section]\ntest\n[/section]\nh4. See also") + assert_parse('

test

blah

', "[section]\ntest\n[/section]\n[spoiler]blah[/spoiler]") end def test_expand_missing_close - assert_parse("

a

", "[section]a") + assert_parse("

a

", "[section]a") end def test_aliased_expand - assert_parse("
hello

blah blah

", "[section=hello]blah blah[/section]") + assert_parse("
hello

blah blah

", "[section=hello]blah blah[/section]") - assert_parse("

inline foo

title

blah blah

", "inline [i]foo [section=title]blah blah[/section]") - assert_parse('

inline foo

title

blah blah

', "inline [spoiler]foo [section=title]blah blah[/section]") + assert_parse("

inline foo

title

blah blah

", "inline [i]foo [section=title]blah blah[/section]") + assert_parse('

inline foo

title

blah blah

', "inline [spoiler]foo [section=title]blah blah[/section]") end def test_expand_with_nested_code - assert_parse("
hello\n
", "[section]\n[code]\nhello\n[/code]\n[/section]") + assert_parse("
hello\n
", "[section]\n[code]\nhello\n[/code]\n[/section]") end def test_expand_with_nested_list - assert_parse("

c

", "[section]\n* a\n* b\n[/section]\nc") + assert_parse("

c

", "[section]\n* a\n* b\n[/section]\nc") end def test_inline_mode