mudrd8mz / moodle-editor_marklar

Markdown friendly editor for Moodle
GNU General Public License v3.0
17 stars 3 forks source link

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

Open lucaboesch opened 4 years ago

lucaboesch commented 4 years ago

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

mudrd8mz commented 4 years ago

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

lucaboesch commented 4 years ago

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

marklar lt gt
maehne commented 4 years ago

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,

lucaboesch commented 4 years ago

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.

maehne commented 4 years ago

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.

mudrd8mz commented 4 years ago

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?

maehne commented 4 years ago

Yes

maehne commented 4 years ago

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.

tayflo commented 3 years ago

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.)

maehne commented 3 years ago

@Tayflo: Please consider voting for MDL-32114.

tayflo commented 3 years ago

Done!

mudrd8mz commented 9 months ago

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.