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

Markdown render #1179

Closed
btzr-io opened this issue Mar 26, 2018 · 9 comments
Closed

Markdown render #1179

btzr-io opened this issue Mar 26, 2018 · 9 comments
Assignees
Labels
area: ux css type: bug Existing functionality is wrong or broken type: improvement Existing (or partially existing) functionality needs to be changed

Comments

@btzr-io
Copy link
Collaborator

btzr-io commented Mar 26, 2018

ℹ️ Update:

  • Some issues aren't related to the markdown component but it's mostly css
  • Tables aren't shown correctly on publish and need a custom style. Markdown render #1179 (comment)

The Issue

Markdown render is missing appropriate css styles, for blockquotes, links, code...
Also some features like headings are disabled but still available in the editor.

Steps to reproduce

  1. Go to a claim page.
  2. See description.

Expected behaviour

Display markdown correctly.

Actual behaviour

Description appears like plain text.

Notes

There are some issues with the markdown component, see: #1023 (comment)

@btzr-io btzr-io added type: bug Existing functionality is wrong or broken type: improvement Existing (or partially existing) functionality needs to be changed area: ux labels Mar 26, 2018
@btzr-io btzr-io changed the title Markdown ignored Markdown css Mar 26, 2018
@tzarebczan
Copy link
Contributor

@btzr-io do you know if this is the same issue as headings not showing up correctly (i.e. # Heading 1)?

See lbry://filecontrols#d2d8e154e4db21c25dc9a9b0e75a3533a59b98f1

"stream": { "metadata": { "author": "", "description": "<h1> test heading html</h1>\n\n# heading 1 md\n## heading 2 md\n## heading 3 md\n\n", "language": "en", "license": "None", "licenseUrl": "", "nsfw": false, "preview": "", "thumbnail": "", "title": "test markdown / html", "version": "_0_1_0"

@btzr-io
Copy link
Collaborator Author

btzr-io commented Apr 17, 2018

Also some features like headings are disabled

@tzarebczan
Copy link
Contributor

Thanks, totally missed that!

@ghost
Copy link

ghost commented Apr 19, 2018

Tables are shown correctly in the preview of the edit page:
capture1

When publishing however, it shows up like this:
capture2

@btzr-io
Copy link
Collaborator Author

btzr-io commented Apr 19, 2018

@tzarebczan Tables, headings and almost anything that is converted into
an html tag / element is intentionally blocked from preview-render.

Probably to prevent: Markdown's XSS Vulnerability

It's possible to enable specific tags (elements),
but I'm not sure what we really want to include 😕

@kauffj
Copy link
Member

kauffj commented Apr 19, 2018

@btzr-io @tzarebczan I'd say allow h3 and smaller and tables. Solution to XSS is orthogonal to this, as long as any elements are included that type of attack is possible.

@tzarebczan
Copy link
Contributor

@btzr-io have you checked out https://github.com/mdx-js/mdx ? @seanyesmunt recently brought it up.

@btzr-io
Copy link
Collaborator Author

btzr-io commented May 4, 2018

@tzarebczan @seanyesmunt This looks more easy to integrate: https://github.com/mapbox/remark-react

@btzr-io btzr-io self-assigned this May 7, 2018
@btzr-io btzr-io changed the title Markdown css Markdown preview May 7, 2018
@btzr-io btzr-io changed the title Markdown preview Markdown render May 7, 2018
btzr-io added a commit that referenced this issue May 7, 2018
@btzr-io btzr-io mentioned this issue May 7, 2018
3 tasks
@tzarebczan
Copy link
Contributor

Fixed in #1441

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ux css type: bug Existing functionality is wrong or broken type: improvement Existing (or partially existing) functionality needs to be changed
Projects
None yet
Development

No branches or pull requests

4 participants