-
Notifications
You must be signed in to change notification settings - Fork 5
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
prevent <code> from being parsed in Pages render #232
Comments
I did some test on this tonight. It is quite easy to make the base work. But... it create many little problems 😬. To make it work, we have to parse Markdown first to have As we can see in this graph https://github.com/vincent-peugnet/wcms/blob/master/RENDER.md, currently, Markdown is after all the W inclusions and the crazy everylink function. So, I'm trying to put it first and se what happen ! According to the unit tests and my own tests two things are broken :
|
This is fixed by 81b028d !! (Took me some time 🥵) |
I think that for now, I could activate this only for the markdown code elements. Because it follow the logic of: Markdown is for easy automatic usage. Unlike raw HTML, where you have more control. In case of plain HTML, it make more sense to use HTML entities to avoir parsing. |
I thought this was easy, but in fact, I don't know how to differentiate markdwon created What I could easily would be to "prevent Markdown libraryI thought I could find a solution by looking at the current MD library used in W. From Michel Fortin's PHP-Markdown configuration doc:
I've tried to use this with htmlentities(), but it did'nt worked (percent sign where untuched) |
Mmhh,
W input
HTML output
This is almost perfect ! But there's one problem: this add some trailing newlines !! 😭 I can trim them, but this is not very good 😵💫 There is no problems with the back-tick code block syntax. |
Maybe I could just escape the There will still be some problems with the URL-linker (but at least it can be disabled). |
EDIT by @n-peugnet:
One idea was to store the content of the code blocks away, using PHP_DOM extension. Then removing their content and adding them a codeblock ID, before parsing the body with the different replacing tools of W. The final step would be to put back the content of each codeblock based on their ID.
The text was updated successfully, but these errors were encountered: