al-niessner / DAWGIE

Other
3 stars 1 forks source link

In templating engine, HTML closing tags are doubly assigned attributes #75

Closed jpl-jengelke closed 4 years ago

jpl-jengelke commented 4 years ago

Two issues in the DAWGIE templating engine (dawgie.de.html.py):

  1. When a style is assigned, both opening and closing tags receive the style, rendering malformed browser content. Example: <p style="color: blue;"></p style="color: blue;">
  2. Void elements are assigned closing tags. Example: <hr></hr>

List of html void elements Also, https://html.spec.whatwg.org/ , see void elements.

jpl-jengelke commented 4 years ago

I would really like to get this into 1.2.8, if possible. I'll try to complete the code tonight.

al-niessner commented 4 years ago

The void element list is small so feel free to add it. No rush as there is not immediate need to release 1.2.8.

jpl-jengelke commented 4 years ago

I've expanded the scope of this slightly but it will only modify the html.py file.

I was working on the rendering to render primitives inline with declarations but it turns out to be too much of a change, so it can be modified later, as desired.

al-niessner commented 4 years ago

Remember it has to work with PDF and Lyx as well. Where it is dawgie.Visitor. In other words, whatever you call in the StateVector.view() it has to render similarly in PDF and Lyx.

jpl-jengelke commented 4 years ago

Got it. I will rely on low-level tags, not inserting them by default. I may need help testing it all. The changes should not be so substantial that they will break either PDF or Latex, I believe.

jpl-jengelke commented 4 years ago

I will make the pull request to the 1.2.9 branch. Thanks.

al-niessner commented 4 years ago

You can make it part of 1.3.0 if you prefer. Just letting you know about the branch to make you aware of the choice you have.

On Wed, Jan 8, 2020 at 12:17 AM John Engelke notifications@github.com wrote:

I will make the pull request to the 1.2.9 branch. Thanks.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/al-niessner/DAWGIE/issues/75?email_source=notifications&email_token=AAIUBIQKVXJT6D35CWMXCUDQ4WD2FA5CNFSM4J2D6KD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEILRS7I#issuecomment-571939197, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIUBIUFSKFLGDDR67SS343Q4WD2FANCNFSM4J2D6KDQ .

jpl-jengelke commented 4 years ago

Should I make the PR to both branches? In other words, if it gets into 1.2.9 will it be in 1.3.0 eventually?

al-niessner commented 4 years ago

No. I recommend master (1.3 release) as there are some pretty scoping changes in it that could make it a merge nightmare from 1.2 to 1.3. That is the clue that if you merge it in 1.2 branch, then it has to be merge to master at some point in time too from the 1.2 branch.

On Wed, Jan 8, 2020 at 8:47 AM John Engelke notifications@github.com wrote:

Should I make the PR to both branches? In other words, if it gets into 1.2.9 will it be in 1.3.0 eventually?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/al-niessner/DAWGIE/issues/75?email_source=notifications&email_token=AAIUBIQRFH3H2WUBIZTWJRTQ4X7RTA5CNFSM4J2D6KD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEINGUAA#issuecomment-572156416, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIUBIQ5MGS35CJPLAZRIULQ4X7RTANCNFSM4J2D6KDQ .

jpl-jengelke commented 4 years ago

I opted for additional changes to include scrubbing input values of potentially malicious code: "Standardized templating on f-strings, added clean methods to limit malicious code, standardized class, id and style attributes, rearranged order to support writing customizations after file loads for script and css imports, remove superfluous variables added to init, separated legacy and new functions to support backwards compatibility."

jpl-jengelke commented 4 years ago

Changes complete for now. Pull requests have been created for the following branches: