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

Underline feature is not working with remark #1279

Closed
4 tasks done
Risini1998 opened this issue Jan 19, 2024 · 4 comments
Closed
4 tasks done

Underline feature is not working with remark #1279

Risini1998 opened this issue Jan 19, 2024 · 4 comments
Labels
🙅 no/wontfix This is not (enough of) an issue for this project 👎 phase/no Post cannot or will not be acted on

Comments

@Risini1998
Copy link

Risini1998 commented Jan 19, 2024

Initial checklist

Problem

I am using the "remark": "15.0.1" version and I tried to display markdown content as follows.

import { remark } from 'remark'
import html from 'remark-html'
import RemarkGfm from 'remark-gfm'

const content = `
 **Hello World**
 
 _Hello World_
 
 <u>Hello World</u>
 
 ~~Hello World~~`

const processedContent = await remark()
      .use(html)
      .use(RemarkGfm)
      .process(content)
    const contentHtml = processedContent.toString()

But underline feature is not working. I have tried remark-underline. But remark-underline requires remark v12. How can I do this?

Solution

According to above example it shows as below.

Hello World

Hello World

Hello World

Hello World

underline is not working.

Alternatives

This can be achieved byreact-remarkpackage. But I want to know the way to do with remark package.

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Jan 19, 2024
@wooorm
Copy link
Member

wooorm commented Jan 19, 2024

What doesn’t work? Please show the exact output you get, and the exact output you want, in code blocks

@Risini1998
Copy link
Author

Risini1998 commented Jan 23, 2024

I get the output as,

image
underline tag was removed and not underlined the 3rd 'Hello World'. I need this output by replacing underlined Hello World in 3rd line.

@wooorm
Copy link
Member

wooorm commented Jan 23, 2024

Take some time to read the readme of html. There are options. Practically you need the sanitize option: https://github.com/remarkjs/remark-html#options.

But also take some time to read the rest of the readme. When you should or shouldn’t use it.

@wooorm wooorm closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2024
@wooorm wooorm added the 🙅 no/wontfix This is not (enough of) an issue for this project label Jan 23, 2024

This comment has been minimized.

@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙅 no/wontfix This is not (enough of) an issue for this project 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants