Git Product home page Git Product logo

Comments (9)

mre avatar mre commented on August 11, 2024 1

I guess what @lebensterben meant was that you use .md as a file extension, where parentheses have a special meaning. If you want to keep Markdown, you can put the link in angular brackets:

<https://raw.githubusercontent.com/ruzickap/ruzickap.github.io/70de7d813c51bbe21762a340c3fa76ced79dedb0/assets/img/posts/2022/2022-09-02-my-sony-a7-iv-settings/Sony_A7_IV_(ILCE-7M4)_-_by_Henry_S%C3%B6derlund_(51739988735).avif>

This works as expected.

Otherwise change the file extension to .txt and you'll find that it also works and finds the full link.

from lychee.

ruzickap avatar ruzickap commented on August 11, 2024

The same issue can be reproduced with:

$ cat > test.md << \EOF
Test: https://upload.wikimedia.org/wikipedia/commons/8/8b/Sony_A7_IV_%28ILCE-7M4%29_-_by_Henry_S%C3%B6derlund_%2851739988735%29.jpg
EOF

$ lychee -v test.md

from lychee.

lebensterben avatar lebensterben commented on August 11, 2024

https://raw.githubusercontent.com/ruzickap/ruzickap.github.io/70de7d813c51bbe21762a340c3fa76ced79dedb0/assets/img/posts/2022/2022-09-02-my-sony-a7-iv-settings/Sony_A7_IV

this is not found

from lychee.

lebensterben avatar lebensterben commented on August 11, 2024

you used a markdown file so you should use a proper link.

the parentheses have special meaning in markdown syntax and thus the parser treats the input after ( differently.

from lychee.

ruzickap avatar ruzickap commented on August 11, 2024

The full URL is (you need to copy the whole URL to test it):

https://raw.githubusercontent.com/ruzickap/ruzickap.github.io/70de7d813c51bbe21762a340c3fa76ced79dedb0/assets/img/posts/2022/2022-09-02-my-sony-a7-iv-settings/Sony_A7_IV_(ILCE-7M4)_-_by_Henry_S%C3%B6derlund_(51739988735).avif

If we consider, that I do not want to use it as a link, but as "normal" text, then it may be:

  • Ignored by lychee and not scan at all
  • Recognized as URL and then tested as "full URL" including all the characters which are part of the URL

-> Lychee should not recognize the patter as URL and then checked "malformed URL" + reported as non-working URL (404).

^^^ It is just my humble opinion...

What do you think about it?

from lychee.

mre avatar mre commented on August 11, 2024

Also see https://meta.stackexchange.com/questions/13501/links-to-urls-containing-parentheses.

from lychee.

lebensterben avatar lebensterben commented on August 11, 2024

We need something like https://github.com/rust-lang/rust/blob/a3c9eede5d50be0231f229bf28a271cd509861a3/src/librustdoc/passes/lint/bare_urls.rs#L61-L89

from lychee.

ruzickap avatar ruzickap commented on August 11, 2024

I'm not sure if I understand it properly. The link you mentioned is saying:

There are many ways to format URLs in Markdown. Parentheses work better with some methods than others.

1. Bare             - http://example.com/test(1).html
2. Bare, encoded    - http://example.com/test%281%29.html
3. Delimited        - <http://example.com/test(1).html>
4. Hyperlink        - with <a href="http://example.com/test(1).html">parens</a>
5. Markdown Link #1 - with [parens][1]
6. Markdown Link #1 - with [parens at end][2]
7. Markdown Link #2 - with [parens](http://example.com/test(1).html)
8. Markdown Link #2 - with [parens at end](http://example.com/test(1))  

In this issue I'm describing (1) - Bare : where I do not want to use the URL as link, but as a standard "non-clickable" pure text.

The question is - if the bare / plain text / clean "URL-text" (including all the characters) in Markdown file should be supported by lychee or not.

Honestly I was not able to find any "official" Markdown standard which is saying - if writing bare URLs is something bad except https://github.com/updownpress/markdown-lint/blob/master/rules/034-no-bare-urls.md.

Anyway - feel free to close this ticket if it is too difficult to support bare URLs in Markdown (containing special characters) by lychee.

Thank you...

from lychee.

lebensterben avatar lebensterben commented on August 11, 2024

@ruzickap

https://ikatyang.github.io/tree-sitter-markdown/

you can use this to test what a markdown parser will treat ( in markdown text.

this is the syntax parser for Neovim and Emacs >30.0.

from lychee.

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.