Comments (6)
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! 🎉
from mdformat.
I guess that'll be hard one to fix. GitHub decided to divert from standard Markdown syntax in their math implementation, and I'm not sure if one can expect that the entire toolchain follows suit. In any case, it'll be hard. (If you're interested, check out my blog posts about it, 1 and 2.)
The best solution for this would be for GitHub to use the backtick math notation like GitLab, i.e.,
$`...`$
from mdformat.
I guess that'll be hard one to fix. GitHub decided to divert from standard Markdown syntax in their math implementation, and I'm not sure if one can expect that the entire toolchain follows suit. In any case, it'll be hard. (If you're interested, check out my blog posts about it, 1 and 2.)
The best solution for this would be for GitHub to use the backtick math notation like GitLab, i.e.,
$`...`$
Thanks for the references. I'll note that this is actually for Docusaurus, not GitHub.
Also, what about the backslash in the html elements?
from mdformat.
Also, what about the backslash in the html elements?
That one looks like a bug to me that's reasonable to fix.
from mdformat.
HTML elements
Your HTML does not seem to be valid so the escape character is there by design.
Perhaps you meant
| Price | Size | Side |
| ----- | ---- | ---------------------------------- |
| 1004 | 10 | <span style="color:red">Ask</span> |
LaTeX
Neither CommonMark nor GFM have any support for LaTeX or any math equation syntax. mdformat-myst brings support for a specific dollarmath syntax, but it seems you don't have it installed. For non standard Markdown syntax support (such as LaTeX) you might want to create your own mdformat plugin.
from mdformat.
HTML elements
Your HTML does not seem to be valid so the escape character is there by design.
Perhaps you meant
| Price | Size | Side | | ----- | ---- | ---------------------------------- | | 1004 | 10 | <span style="color:red">Ask</span> |
LaTeX
Neither CommonMark nor GFM have any support for LaTeX or any math equation syntax. mdformat-myst brings support for a specific dollarmath syntax, but it seems you don't have it installed. For non standard Markdown syntax support (such as LaTeX) you might want to create your own mdformat plugin.
@hukkin Thanks for the tips here! Since I'm using Docusaurus the HTML format you suggested doesn't work (Docusaurus instead requires JSX), so I ended up defining a custom ColoredText
component in src/components/ColoredText.js
:
import React from 'react';
export default function ColoredText({children, color}) {
return (<span style={{color: color}}>{children}</span>);
}
Then I updating the table entries to read:
| Price | Size | Side |
| ----- | ---- | ---------------------------------------------- |
| 1004 | 10 | <ColoredText color="#ff0000">Ask</ColoredText> |
This way the formatter doesn't end up inserting a backslash, and Docusaurus doesn't throw an error for inlining with non-JSX syntax.
As for the LaTeX, mdformat-myst ended up solving the problem! I just had to remove mdformat_footnote
from pyproject.toml
since both tools handle footnotes:
[tool.poetry.dev-dependencies]
autoflake = "^2.0.1"
mdformat = "0.7.16"
mdformat-frontmatter = "2.0.1"
mdformat-myst = "0.1.5"
mdformat-gfm = "0.3.5"
from mdformat.
Related Issues (20)
- Alt text wrapped in grave marks is deleted HOT 2
- Formatted md renders different html than original md HOT 2
- image path is falsely patched with `<>` if URL includes `()`, breaks render HOT 5
- Double slash in math formular HOT 3
- Incorrecly reformats python code HOT 1
- convert inline links to references? HOT 2
- Support json schema
- Word-wrap on sentence (punctuation) and width. HOT 1
- Inline elements in image descriptions are flattened and stripped HOT 2
- Numbers in ordererd lists are ignored when using MDRenderer/MDFormat HOT 3
- Feature request: Respect .gitignore'd files HOT 1
- Checkbox convert HOT 2
- Options to disable/enable rules HOT 3
- Option to specify path to configuration file HOT 1
- Support plugin options in the configuration file HOT 1
- Format output as filename:lineno: message
- Non standard output between core and plugins?
- On/off comments
- Wrapping of badge lines
- Configure default language for fenced code blocks HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mdformat.