Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with line starting with HTML comment #361

Open
eksperimental opened this issue Jun 25, 2020 · 2 comments
Open

Bug with line starting with HTML comment #361

eksperimental opened this issue Jun 25, 2020 · 2 comments

Comments

@eksperimental
Copy link
Contributor

iex(10)> Earmark.as_ast "<!-- Replace with better image -->  anything that follows the comment is lost <img src=\"picture.png\"/>"
{:ok, [comment: [" Replace with better image "]], []}

iex(11)> Earmark.as_ast "<img src=\"picture.png\"/> <!-- Replace with better image --> this is not lost"                          
{:ok,
 [
   {"img", [{"src", "picture.png"}], [], %{meta: %{verbatim: true}}},
   "<!-- Replace with better image --> this is not lost"
 ], []}
@RobertDober
Copy link
Collaborator

will be fixed with RobertDober/earmark_parser#6

@bradhanks
Copy link
Contributor

iex(1)>  Earmark.as_ast "<!-- Replace with better image -->  anything that follows the comment is lost <img src=\"picture.png\"/>"
{:ok,
 [
   {:comment, [], [" Replace with better image "], %{comment: true}},
   {"p", [],
    ["  anything that follows the comment is lost <img src=\"picture.png\"/>"],
    %{}}
 ],
 [
   {:warning, 0,
    "DEPRECATION: Earmark.as_ast will be removed in version 1.5, please use Earmark.Parser.as_ast, which is of the same type"}
 ]}

bradhanks added a commit to bradhanks/earmark that referenced this issue Feb 5, 2024
amit-chaudhari1 pushed a commit that referenced this issue Feb 12, 2024
* Bug with line starting with HTML comment #361

* lib/earmark_parser/line_scanner.ex: regex refactor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants