-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
It is possible to corrupt the generated HTML by including things that look like HTML tags within the name and desc. This is legal in the systemRDL syntax but corrupts the generated HTML.
Consider the following case:
addrmap reg_name_stress {
reg {name="The register controls the <h1> signal";
field { name="This field has some <td> controls"; fieldwidth=1; } field_a;
field { name="This field has some normal controls"; fieldwidth=1; } field_b; } reg_h;
};
This will render as follows:
and:
I think the correct behaviour would be to escape the problematic content as it passes through the peakrdl-html. For example
The register controls the <h1> signal
should be converted to
The register controls the &t;h1> signal
This may be better solved in systemrdl-compiler get_html_desc and get_html_name functions rather than being an issue with the peakrdl-html. The markdown syntax defined by systemRDL does not use any of the characters normally escaped in an HTML string therefore I think it might be safe to simply convert as follows:
| Character | Safe Form (escaped) | Comments |
|---|---|---|
| & | & |
|
| < | < |
|
| > | > |
|
| \" | " |
Note that SystemRDL has provision to include a " with an \" which requires slightly different treatment compared to normal |
| ' | ' |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

