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

Regression: HTML comments get escaped #5

Open
ir-regular opened this issue Mar 7, 2020 · 1 comment
Open

Regression: HTML comments get escaped #5

ir-regular opened this issue Mar 7, 2020 · 1 comment

Comments

@ir-regular
Copy link
Contributor

ir-regular commented Mar 7, 2020

Symptom:

  1. Turn on Cryogen "previews" in a new installation (:previews? true)
  2. Add <!–- more -–> after one paragraph in one post
  3. <!–- more -–> is escaped and rendered to the user. Furthermore, it does not restrict snippet length.

Reason:

Snippet trimming function expects <!-- more --> to be parsed as an HTML comment. (See more-marker?) However, this is what it gets: {:tag :p, :attrs nil, :content (<!–-more-–>)}

Tried:

I printed the document at various stages of rendering, and found that the comment comes out already escaped from render-fn (as defined in cryogen-flexmark plugin).

Flexmark does have a couple different flags related to comments and escaping, which I tried setting to false (even though they should be false by default). This didn't help. There don't seem to be any open issues for HTML comments in the flexmark project.

Next:

Be good if someone else read the flexmark documentation again, I might have missed the relevant flag combination.

You could also look at the Document object that comes out of Parser.parse and see if it parsed the comment correctly. This would narrow down the flag search to either parsing or rendering. Unfortunately I don't have the environment set up for this at the moment.

@holyjak
Copy link
Contributor

holyjak commented Oct 5, 2021

@ir-regular Are you sure? It seems to be working for me - see https://github.com/holyjak/tmp-demo-cryogen-posts-everywhere/tree/demo-more-comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants