#3858 - comcode-code garbling code
0 guests and 0 members have recently viewed this.
The top 3 point earners from 14th Dec 2025 to 21st Dec 2025.
| PDStig |
|
|
|---|---|---|
| Gabri |
|
|
| sholzy |
|
|
There are no events at this time
https://pastebin.com/9BME6qEE
Using code or comcode-code tags, Composr tries to run the loop (just tested again). A parameter, _loop_var, is referenced in the template, ???, but not passed
Neither of those things are meant to be done, because it produces a non-nonsensical situation - comcode-code is not user-editable syntax, it's a means to an end to allow WYSIWYG to work. If normal typing was done inside the WYSIWYG, or pasting, it would show as HTML-entity-encoded.
If it is running the loop though, that is a bug, and I'll look into it.
I couldn't paste the cookie consent code either on Compo.sr forums, without it getting mangled. I used the button on the WYSIWYG screen and then went to source to paste code.
The parsing of the code tags when the WYSIWYG editor is involved is necessarily complicated by the way. In Comcode 'code' means that the contents is direct-typed code, but with WYSIWYG that is embedded within an HTML context. This means it has to be converted back to raw code, and then re-processed. If there is actual active HTML in there, not just encoded text characters, then that's paradoxical (makes no sense for a 'code' tag) but will be allowed to flow through but with the same level of HTML security that the posting user has.
(Click to enlarge)
https://pastebin.com/s3zqVwXi
should process to the following HTML, basically...
https://pastebin.com/xfCsFB6k
NOT...
https://pastebin.com/zVzxye7F
Because when the WYSIWYG editor is involved HTML tags represent visual layout (e.g. div, br, p, etc) will inevitably get in there just through basic use of the WYSIWYG editor. If we process this as if it is meant to be displayed as the raw HTML it will totally confuse the user.
I suppose we could try and handle different HTML tags differently rather than let them all through, but that would be even more confusing.
This may be partly due to our security filtering as HTML script tags are involved, I'm not sure.
To reiterate, don't paste anything inside comcode-code inside the WYSIWYG source view, it'll never do what you expect and is not supported.
I have tested and you can paste directly into a code tag inside the WYSIWYG editor main view on Chrome. On Firefox there's a bug in that it force-closes the code tag mid-paste. You can workaround that by holding shift when pasting, or by pasting THEN selecting the text and clicking the code tag button.
But none of this will work well until the next patch release, due to the variety of subtle bugs I had to fix.