Skip to content

Markdown renders incorrectly for event descriptions #220

@zowiebeha

Description

@zowiebeha

The event description data from meetup.com is markdown code.
I've written a parser to convert bold markdown tags into HTML, however I've missed tags like headings and links:

Image

The implementation for this should be considerate of semantic HTML (<span class="font-bold"> instead of <b> or <strong>).

We can do away with <h1>-<h6> headings if they appear in the markdown, since we'd like to represent the description as a paragraph with nested spans.

For links, we can embed an anchor that uses target="_blank" to ensure the target opens in a new browser tab.

We'll need to ensure that every markdown tag is considered and either made into a sensible HTML span, or done away with if it doesn't make sense as a paragraph child.

This bug fix can replace the current bold markdown parser. It should gracefully handle cases where a markdown starting tag does not have an ending tag due to truncation by ellipsis. The code can strip this from the final output, or it can act as though the end tag is at the very end of the truncated string.

The following library might be a good pre-written piece of code to leverage for this task. Feel free to use what works best here, since remark might not work with our current node v16.20.2 (lts/gallium). Its HTML sanitization dependency also appears to have not been updated for awhile which is another thing to consider:

https://github.com/remarkjs/remark-html

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions