Comments (4)
I've confirmed that the angle brackets are needed. Here's some test vectors that should be added to test_renderer_correctness.py
:
-
![link](<foo(and(bar)>)
-
![link](foo\(and\(bar\))
-
![link](foo\)\:)
-
![a](<b)c>)
from mdformat.
So is it just that <>
need to be added if a link contains an internal (
or )
?
If so, would it be "nicer" formatting, if you only added <>
when these were found in the link?
from mdformat.
From https://spec.commonmark.org/0.29/#links:
A link destination consists of either
- a sequence of zero or more characters between an opening < and a closing > that contains no line breaks or unescaped < or > characters,
- or a nonempty sequence of characters that does not start with <, does not include ASCII space or control characters, and includes parentheses only if (a) they are backslash-escaped or (b) they are part of a balanced pair of unescaped parentheses. (Implementations may impose limits on parentheses nesting to avoid performance issues, but at least three levels of nesting should be supported.)
I don't have a strong preference regarding the style. Without the brackets could be "nicer", but with the brackets it's simpler formatting logic and the links will always look the same (this can sometimes be handy for grepping, regexing etc a file). If you have a strong preference for "without the brackets" style, I will merge it.
Fixing the bug is a bigger priority for me, and should be easiest to implement by adding the brackets.
from mdformat.
fair, something to add to explainer docs 😉
from mdformat.
Related Issues (20)
- Consider respecting gfm checklists HOT 1
- Support for Front Matter with Markdown page metadata HOT 1
- `--wrap n` should respect tables HOT 2
- Escape "\|" not working in table cell HOT 3
- Support XGG base directory specification for user configuration resolution
- Checkboxes are escaped HOT 3
- mdformat breaks Hugo shortcodes by escaping `<` HOT 5
- markdown-it-py 3 support
- Not Working In Python 3.11? HOT 5
- Error: Could not format HOT 2
- 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
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.