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

Some IDF object names can break the HTML output file #8542

Closed
3 tasks done
santoshphilip opened this issue Feb 16, 2021 · 5 comments · Fixed by #8544
Closed
3 tasks done

Some IDF object names can break the HTML output file #8542

santoshphilip opened this issue Feb 16, 2021 · 5 comments · Fixed by #8544
Assignees
Labels
Defect Includes code to repair a defect in EnergyPlus

Comments

@santoshphilip
Copy link

santoshphilip commented Feb 16, 2021

Problem

  • The EnergyPlus objects can have legal names in the following format Special glass <thickness is 3mm>
  • Energyplus itself has no problems with such names
  • This name turns up in the HTML output file.
    • In the HTML file the part name<thickness is 3mm> looks like an HTML tag.
    • The browser tries to make sense of it and fix it so that something can be displayed
    • This results in a mangled name in the HTML file as viewed in the browser

Solution

  • Before the name goes into the HTML file, it has to be modified in the following manner
    • Special glass <thickness is 3mm> should become Special glass &lt;thickness is 3mm&gt;
    • &lt; becomes < in the browser and &gt; becomes > in the browser

Details

Some additional details for this issue (if relevant):

  • Platform (Operating system, version): all
  • EnergyPlus version: current develop, circa v9.4.0-IOFreeze, ea7967b

Checklist

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Defect file added (list location of defect file here)
  • Ticket added to Pivotal for defect (development team task)
  • Pull request created (the pull request will have additional tasks related to reviewing changes that fix this defect): Fix #8542 - Escape HTML characters.  #8544
@JasonGlazer JasonGlazer added the Defect Includes code to repair a defect in EnergyPlus label Feb 16, 2021
@jmarrec jmarrec self-assigned this Feb 17, 2021
@jmarrec
Copy link
Contributor

jmarrec commented Feb 17, 2021

Thanks for the report @santoshphilip. I added the checklist to your original post.

@JasonGlazer
Copy link
Contributor

The fix should also be included for the XML output file (OutputControl:Table:Style, XML) which I don't think is commonly used but would face the same issue with confused tags.

@jmarrec
Copy link
Contributor

jmarrec commented Feb 17, 2021

@JasonGlazer XML is fine already:

bodyEsc(iCol, jRow) = ConvertToEscaped(body(iCol, jRow));

@JasonGlazer
Copy link
Contributor

Good. To bad the author of ConvertToEscaped() didn't think of applying it to the HTML file :-)

jmarrec added a commit that referenced this issue Feb 17, 2021
jmarrec added a commit that referenced this issue Feb 17, 2021
Added an optional boolean argument to ConvertToEscape to not convert " and ' like it would in the original routine which was meant for XML. This is to support HTML4 mostly, but might as well be correct.
@jmarrec
Copy link
Contributor

jmarrec commented Feb 17, 2021

I'm guessing it was you, but it's been there as far as this repo's git history can go (7+ years), so who knows when it was really added and what HTML looked like then :)

Myoldmopar added a commit that referenced this issue Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants