Skip to content
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

Bug in Parsing Code Causing mismatch of mlang tags #18

Open
28Smiles opened this issue Mar 12, 2025 · 0 comments
Open

Bug in Parsing Code Causing mismatch of mlang tags #18

28Smiles opened this issue Mar 12, 2025 · 0 comments

Comments

@28Smiles
Copy link

28Smiles commented Mar 12, 2025

Minimal sample:
{mlang de}<br>{mlang}

Using the <br> or <br/> tag causes the parser to create mlang tags due to mismatching opening/closing tags:

Image


https://github.com/bfh/moodle-tiny_multilang2/blob/main/amd/src/htmlparser.js#L134 after further investigation, it seems like all imbalanced tags should show this behavior. One can argue, if the prevention of imbalanced tags in the parser of the plugin is even neccessary or beneficial, if the backend implementation is not checking for those things. Either way, another fix could be to add special cases for imbalanced tags like <br>, <img>

Another sample ist just placing an img inside mlang {mlang de}<img src="...">{mlang}


More over using mlang across tags like: <p>{mlang de}</p><p></p><p>{mlang}</p>, results create of tags. The introduction of the html parser forces mlang tags to ONLY be filled by raw text and NO html tag at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant