Giter VIP home page Giter VIP logo

Comments (6)

welcome avatar welcome commented on June 12, 2024

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.

nschloe avatar nschloe commented on June 12, 2024

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.

alnoki avatar alnoki commented on June 12, 2024

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.

nschloe avatar nschloe commented on June 12, 2024

Also, what about the backslash in the html elements?

That one looks like a bug to me that's reasonable to fix.

from mdformat.

hukkin avatar hukkin commented on June 12, 2024

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.

alnoki avatar alnoki commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.