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

<font> element does not work #759

Closed
4 tasks done
PDmeaning opened this issue Aug 1, 2023 · 7 comments
Closed
4 tasks done

<font> element does not work #759

PDmeaning opened this issue Aug 1, 2023 · 7 comments
Labels
🤷 no/invalid This cannot be acted upon 👎 phase/no Post cannot or will not be acted on

Comments

@PDmeaning
Copy link

Initial checklist

Affected packages and versions

5.0.3 version

Link to runnable example

No response

Steps to reproduce

<ReactMarkdown
children={input}
plugins={[gfm]}
escapeHtml={false}
renderers={{ code: CodeBlock }}
/>
input="text",
but the output of html show as "text",
so the color cant show right

Expected behavior

the color of text is "#ff0000"

Actual behavior

the color of text is default(black)

Runtime

Node v16

Package manager

npm 8

OS

macOS

Build and bundle tools

Webpack

@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 Aug 1, 2023
@wooorm
Copy link
Member

wooorm commented Aug 1, 2023

Please use markdown, this question is not readable

@PDmeaning
Copy link
Author

input: <font color=\"#ff0000\">text</font>;
output:<span><font color=\"#ff0000\"></span><span>text</span><span></span>

@wooorm
Copy link
Member

wooorm commented Aug 1, 2023

Don‘t use font? It’s ancient and not supported by React? https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font
facebook/react#2627.

@wooorm wooorm closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2023
@wooorm wooorm added the 🤷 no/invalid This cannot be acted upon label Aug 1, 2023
@github-actions

This comment has been minimized.

@wooorm wooorm changed the title color in html can't render <font> element does not work Aug 1, 2023
@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 Aug 1, 2023
@PDmeaning
Copy link
Author

input:<span style="color:#ff0000">aaaaaaaaaaa</span>;
output:<span><span style="color:#ff0000"></span></span><span>aaaaaaaaaaa</span><span></span>

@PDmeaning
Copy link
Author

input:<span style="color:#ff0000">aaaaaaaaaaa</span>;
output:<span><span style="color:#ff0000"></span></span><span>aaaaaaaaaaa</span><span></span>

but the span also render right, there are extra html elements;
input:<span style="color:#ff0000">text</span>;
output:<span><span style="color:#ff0000"></span></span><span>text</span><span></span>

@ChristianMurphy
Copy link
Member

ChristianMurphy commented Aug 3, 2023

@PDmeaning I'm not sure what you are doing/using.
react-markdown and rehype-raw do not add extra spans.
runnable example of what react-markdown does: https://stackblitz.com/edit/github-tun7qz?file=src%2Fapp.tsx

source from sandbox
import React from 'react';
import Markdown from 'react-markdown';
import rehypeRaw from 'rehype-raw';

const markdownSource = `
<span style="color:#ff0000">text</span>
`;

const App = () => (
  <Markdown rehypePlugins={[rehypeRaw]}>{markdownSource}</Markdown>
);

export default App;

If you have any follow up questions, please read the support guidelines on how to ask quality questions: https://github.com/remarkjs/.github/blob/main/support.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤷 no/invalid This cannot be acted upon 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

3 participants