-
Notifications
You must be signed in to change notification settings - Fork 40
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
mustache_lint: Wrap stray tags into valid parent. #195
base: main
Are you sure you want to change the base?
mustache_lint: Wrap stray tags into valid parent. #195
Conversation
Stray tags are those that got strict parent requirement, e.g. you can't use <li>...</li> without wrapping it in <ul>...</ul> tag.
Attempt to fix a partial template containing elements with a strict parent requirements.
Thinking if it needs some watchdog for while loops count? (if someone add a new elements mapping that would point to each other, this may produce an infinite loop) :/ |
I like the concept of this solution to avoid more false positives (the the primitive html wrapping was always a bit of a ugly hack). Though worth noting that a proper declarative metadata type solution might have some value and was how I intended to get this fixed: https://tracker.moodle.org/browse/MDL-56504 It would help the template library too |
Yes, to be honest Dan I found MDL-56504 ticket when the code for this solution was ready, thus decided to create PR anyway. Need to make it a habit to search tickets before starting writing anything 😄 |
Hi, sorry for the delay... somehow I got this by email but ended well down in my lists! Just thinking if, maybe... both solutions could coexist. In this way:
Not sure about the exact way to put everything working together, just drafting how they may work (the clever wrapping, the detected partials used, the html validation and the future partials tag). |
2524a78
to
44c50d6
Compare
975e856
to
2a863f0
Compare
7c835b9
to
0126fe3
Compare
So other than a rebase and dust the cobwebs off, whats left to get this fixed? |
Cross-linking with https://tracker.moodle.org/browse/MDLSITE-6744, for the records. |
This fix is partially addressing MDL-56504 by adding an extra wrappers to tags that have strict parent requirement according to the spec (e.g. it is invalid to use
<li>...</li>
without wrapping it<ul>...</ul>
tag).Bats run output:
If only test (ac593e9) is applied:
when feature patch (8523227) is applied: