gjbarnard / moodle-filter_synhi

Syntax highlighter
GNU General Public License v3.0
2 stars 2 forks source link

[Moodle 3.11.6] FR: Highlight content that gets loaded via AJAX #6

Open danowar2k opened 2 years ago

danowar2k commented 2 years ago

Right now, it seems that content is only highlighted when loaded with the page request. When using a course format like format_tiles (https://bitbucket.org/dw8/moodle-format_tiles) content may be loaded after the fact via AJAX (e.g. clicking on a tile loads the section content via AJAX).

It would be nice if that AJAX loaded content could also be highlighted. Maybe use a Mutator to listen for new content?

gjb2048 commented 2 years ago

@danowar2k Good point, do you have a patch with a proposed solution please?

danowar2k commented 2 years ago

It depends, what happens if you run "thejs" twice, i.e. init EnlighterJS twice on a single page?

Does it ignore the already highlighted DOM parts oder does it try to highlight those, breaking everything?

gjb2048 commented 2 years ago

@danowar2k I don't know, what does your testing show?