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

Render error when string in example contains '</' #168

Closed
aleung opened this issue Mar 25, 2021 · 6 comments · Fixed by #166
Closed

Render error when string in example contains '</' #168

aleung opened this issue Mar 25, 2021 · 6 comments · Fixed by #166
Labels
bug Something isn't working

Comments

@aleung
Copy link

aleung commented Mar 25, 2021

Describe the bug

The content of string in example can not be correctly render when the string contains </.

How to Reproduce

generator version: 1.6.2
html-template version: 0.18.1

Screenshots
Selection_018

Files that can help reproduce the issue

asyncapi: 2.0.0
info:
  title: Test
  version: 1.0.0
channels:
  testcase:
    subscribe:
      message:
        $ref: '#/components/messages/LwM2mOjbects'
components:
  messages:
    LwM2mOjbects:
      payload:
        type: object
        properties:
          objectLinks:
            type: string
        example:
          objectLinks: "lwm2m=1.1, </0/0>, </1/1>;ssid=1, </2>, </3/0>"

Expected behavior

In generated HTML, the objectLinks in example should be shown as same as the value in definition file, containing </0/0>...

@aleung aleung added the bug Something isn't working label Mar 25, 2021
@github-actions
Copy link

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.

Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@magicmatatjahu
Copy link
Member

@aleung Hi! Thanks for report issue! Most likely it is due to sanitizing example -> here https://github.com/asyncapi/html-template/blob/master/partials/example.html#L20 @derberg Do you know why we sanitize examples?

@derberg
Copy link
Member

derberg commented Mar 25, 2021

tbh you would have to try to remove the safe filter and see what happens with HTML input, maybe it was breaking the UI? 🤷🏼 it was there in the initial version which means for a very long time and I bet that even @fmvilas do not remember why he added it there

@magicmatatjahu
Copy link
Member

@aleung Hi! Sorry for late response. Currently we are unifying HTML-Template with React component in this PR #166 I fixed this bug in unification. Could you wait for it (max next 2 weeks)?

@aleung
Copy link
Author

aleung commented Apr 9, 2021

No problem. Thanks! @magicmatatjahu

@magicmatatjahu
Copy link
Member

Fixed in @asyncapi/[email protected] @aleung Reopen if will you found bugs, and sorry for delay 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants