From 92e7a8bf17a64f907d23f17703cacd685b668ec4 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sat, 28 Dec 2019 13:07:32 -0500 Subject: [PATCH] additionally forbid opening markup to come before a space --- lib/fast_textile/parser.ex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/fast_textile/parser.ex b/lib/fast_textile/parser.ex index 81e9d429..5bc2754f 100644 --- a/lib/fast_textile/parser.ex +++ b/lib/fast_textile/parser.ex @@ -82,6 +82,11 @@ defmodule FastTextile.Parser do # # open_token callback* close_token (?!lookahead_not) # + defp simple_lookahead_not(open_token, _close_token, _open_tag, _close_tag, _lookahead_not, _callback, _state, _parser, [{open_token, open}, {forbidden_lookahead, t} | r_tokens]) + when forbidden_lookahead in [:space, :newline] + do + {:ok, [{:text, escape(open)}], [{forbidden_lookahead, t} | r_tokens]} + end defp simple_lookahead_not(open_token, close_token, open_tag, close_tag, lookahead_not, callback, state, parser, [{open_token, open} | r_tokens]) do case parser.state do %{^state => _} ->