Closed ivilata closed 2 years ago
Thanks. The problem is essentially that MD4C parser does not provide information about the formatting of the links, so I can't differentiate between [foo][]
and [foo]
. You can see the information provided by MD4C in link spans appending the --debug
option:
This was implemented in #204 (here) and could be implemented in either format, always being the same for all, but used this because is simpler. As I can see, Github accept all possible formats as valid links:
[example1]
[example1]: https://example1.com
[example2][example2]
[example2]: https://example2.com
[example3][]
[example3]: https://example3.com
Really this issue is a duplicate of #152, but as said, is not possible to implement it, at least for now. Of course, PRs are welcome!
Do you know other parsers that would not be able to parse links like [foo]
?
Thanks @mondeja for the clarification! Since I have usually followed John Gruber's original specs, I've never used [foo]
myself, so I can't list other parsers beyond GitHub's md
syntax highlighter and Emacs' markdown-mode
.
So, since the parsing issue is out of your control, and the choice between [foo][]
and [foo]
seems mostly aesthetic, feel free to close this issue. Thanks!
(After the last comments from #164.)
According to CommonMark link specs, a collapsed reference link like
[foo][]
and a shortcut reference link like[foo]
should both be valid and equivalent to[foo][foo]
.However,
md2po
0.3.84 converts collapsed links to shortcut ones in POT entries. For instance, with atest.md
with the following content:the command
md2po test.md > test.po
creates these entries (I added the missing translation):Then
po2md -p test.po -s /dev/stdout test.md
produces:The final output is correct, the issue is that PO strings slightly differ from the original ones. I would expect that both
[foo][]
and[foo]
keep their shape in the PO file.Please note that the original Markdown contemplated
[foo][]
but not[foo]
as valid links, so thay may affect some editors or syntax highlighters (like GitHub's).This started happening with mdpo 0.3.80 (while 0.3.79 would convert them to
[example.com][example.com]
instead, which confuses some translators).Thank you!