systemrdl-compiler icon indicating copy to clipboard operation
systemrdl-compiler copied to clipboard

Escaping name and desc properties before converting to HMTL

Open krcb197 opened this issue 1 year ago • 3 comments

This PR addresses some undesirable things that can happen with the legal system RDL format string but would result in undesirable problems in HTML. See the following issue tickets:

  • systemrdl/peakrdl-html#53
  • krcb197/peakrdl-python#169

There are two parts to this:

  1. The systemRDL string is escaped with the builtin python html.escape function before conversion
  2. The systemrdl [quote] and [/quote] constructs are converted to HTML as " rather than "

krcb197 avatar Feb 24 '25 19:02 krcb197

Coverage Status

coverage: 92.306% (+0.004%) from 92.302% when pulling 4b4c74edac14883b8a0c449a5790d9fbe7c65d11 on krcb197:escaping_html into 3deb51bdb2dde59bd4b06a6e87c30064f43cd984 on SystemRDL:main.

coveralls avatar Feb 24 '25 20:02 coveralls

See my comments in parent issue https://github.com/SystemRDL/PeakRDL-html/issues/53 I cannot justify merging this change as-is. Perhaps just the 2nd part for RDLFormatCode [quote] and [/quote] tags.

amykyta3 avatar Feb 27 '25 05:02 amykyta3

@amykyta3

Thank you for the review comments. I understand that escaping the HTML characters can not be the default behaviour.

I still think it may be helpful in some cases to clean the desc and name properties, I have resubmitted the PR with this as an optional behaviour (off by default). I discovered that the & is escaped by default when the markdown processor is applied.

Does that address your concerns?

krcb197 avatar Mar 01 '25 09:03 krcb197