moodle-editor_marklar icon indicating copy to clipboard operation
moodle-editor_marklar copied to clipboard

Please advise < > displayed as &lt; &gt;

Open lucaboesch opened this issue 5 years ago • 12 comments

Dear David, could you please advise me, if that's a Marklar thing or Moodle thing or if there's any Tracker Issue already? A lecturer writes to me:

Hello, Luca,

I just encountered the following problem when editing a text field in Moodle, for that I use the Markdown format (of course with Marklar :-) ). With the help of Backticks verbatim code snippets can be entered in the body text. If they do contain < and >, they will not be displayed correctly, because they are automatically displayed as &lt; and &gt; . So they seem to be converted when saving. When rendering, however, no reverse translation takes place.

Thanks a lot.

Best, Luca

lucaboesch avatar Dec 13 '19 10:12 lucaboesch

Are you able to reproduce the behaviour when using the Plain text editor + Markdown format?

mudrd8mz avatar Dec 13 '19 17:12 mudrd8mz

That seems to work correctly. In other words: no I can't reproduce this with the Plain text editor + Markdown.

marklar lt gt

lucaboesch avatar Dec 13 '19 18:12 lucaboesch

I am the lecturer, who observed the issue. I was able to isolate the problem a bit further. As @lucaboesch showed, entering < and > in Markdown format works for normal Moodle text fields independently if Marklar or the Plain text editor is used. However, in Moodle Forum posts the problem appears that < and > show as &lt; and &gt; in messages entered in Markdown format (using either Marklar or the Plain text editor). The only workaround I found so far is switching to HTML format for the message instead of Markdown, which is very tedious,

maehne avatar Dec 31 '19 18:12 maehne

Oh I probably found the related MDL issue https://tracker.moodle.org/browse/MDL-32114, did I, David? Unfortunately not the solution, but the issue at least.

lucaboesch avatar Jan 24 '20 15:01 lucaboesch

I have tested the work around mentioned in MDL issue #32114:

image

So, it seems to work, but this long-standing MDL issue #32114 definitely deserves being fixed. We actively use Moodle forums to support our students doing programming projects. I.e., it is important to be able to easily format code snippets in forum messages.

maehne avatar Jan 28 '20 17:01 maehne

Well, if I recall MDL-32114 correctly, this would be related if we see the buggy behaviour in the Forum, but it would work as expected in other places (such as the profile description). Is that correct?

mudrd8mz avatar Feb 12 '20 17:02 mudrd8mz

Yes

maehne avatar Feb 12 '20 17:02 maehne

This bug becomes even more annoying when quoting other people in Forum replies, as the formatting gets completely destroyed. The workaround from MDL issue #32114 won't help in this case.

maehne avatar Mar 19 '20 14:03 maehne

I can confirm, this is very annoying in forums related to programming (in R it messes up both assignment <- and pipes %>% operators, which are used all the time).

The workaround with <pre>my code with < and ></pre> (the <code> element seems unecessary) is (as I tested it) not very intuitive, hard to find, and doesn't work inline.

(I'm not 100% sure that my institution is using Marklar for Markdown rendering though, as I don't know well how Moodle works and as I have no admin power on the platform I don't know how to check this, but still the issue appears when selecting markdown formatting, so it looks to be the same issue.)

tayflo avatar Jan 01 '21 09:01 tayflo

@Tayflo: Please consider voting for MDL-32114.

maehne avatar Jan 01 '21 14:01 maehne

Done!

tayflo avatar Jan 01 '21 15:01 tayflo

As I can see from the tracker and my own experiments, Moodle 4.2 is not affected any more. I think we can close this.

mudrd8mz avatar Mar 06 '24 21:03 mudrd8mz