mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-20 06:37:59 +01:00
handle adjacent markup rules correctly
This commit is contained in:
parent
84bba9062b
commit
e24c3e812f
2 changed files with 13 additions and 7 deletions
|
@ -192,16 +192,22 @@ defmodule Textile.Lexer do
|
|||
|
||||
# Textile
|
||||
|
||||
markup_ends =
|
||||
choice([
|
||||
spoiler_close,
|
||||
blockquote_close,
|
||||
eos()
|
||||
])
|
||||
|
||||
{markup_start, markup_element} = markup_ending_in(eos())
|
||||
{markup_start, markup_element} = markup_ending_in(markup_ends)
|
||||
|
||||
textile_default =
|
||||
choice([
|
||||
bracketed_literal,
|
||||
blockquote_open_cite,
|
||||
blockquote_open,
|
||||
blockquote_open_cite |> optional(markup_start),
|
||||
blockquote_open |> optional(markup_start),
|
||||
blockquote_close,
|
||||
spoiler_open,
|
||||
spoiler_open |> optional(markup_start),
|
||||
spoiler_close,
|
||||
link,
|
||||
image
|
||||
|
|
|
@ -149,7 +149,7 @@ defmodule Textile.MarkupLexer do
|
|||
|
||||
markup_at_start =
|
||||
choice([
|
||||
markup_opening_tags,
|
||||
times(markup_opening_tags, min: 1),
|
||||
bracketed_markup_opening_tags
|
||||
])
|
||||
|
||||
|
@ -159,8 +159,8 @@ defmodule Textile.MarkupLexer do
|
|||
literal,
|
||||
bracketed_markup_closing_tags,
|
||||
bracketed_markup_opening_tags |> lookahead_not(space()),
|
||||
preceding_whitespace |> concat(markup_opening_tags),
|
||||
markup_closing_tags |> lookahead(choice([special_characters(), ending_sequence])),
|
||||
preceding_whitespace |> times(markup_opening_tags, min: 1),
|
||||
times(markup_closing_tags, min: 1) |> lookahead(choice([special_characters(), ending_sequence])),
|
||||
double_newline,
|
||||
newline,
|
||||
utf8_char([])
|
||||
|
|
Loading…
Reference in a new issue