Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix square brackets that are parsed as links #3

Closed
12 tasks
imsky opened this issue Jun 29, 2014 · 3 comments
Closed
12 tasks

Fix square brackets that are parsed as links #3

imsky opened this issue Jun 29, 2014 · 3 comments
Milestone

Comments

@imsky
Copy link
Owner

imsky commented Jun 29, 2014

Some matrix references are parsed as links, etc

  • 149
  • 165
  • 186
  • 211
  • 228
  • 230
  • 363
  • 383
  • 444
  • 460
  • 461
  • 468
@imsky imsky added this to the 1.0 milestone Jun 30, 2014
@imsky
Copy link
Owner Author

imsky commented Apr 30, 2016

thanks for doing this, i'll convert it into a checklist

@jayvdb jayvdb changed the title Fix Markdown artifacts in original file Fix square brackets that are parsed as links Jun 14, 2016
@jayvdb
Copy link
Collaborator

jayvdb commented Jun 14, 2016

https://github.com/wooorm/remark-validate-links correctly identifies some of these:

$ remark -u remark-validate-links README.md --no-stdout
README.md
  5212:35-5212:41    warning  Link to unknown file: `n`
  5217:57-5217:63    warning  Link to unknown file: `n`
  5623:21-5623:29    warning  Link to unknown file: `n`
  5628:50-5628:59    warning  Link to unknown file: `35`
  5638:7-5638:16     warning  Link to unknown file: `35`
  5650:33-5650:53    warning  Link to unknown file: `(127+19n)×7%5En`
  9679:9-9679:15     warning  Link to unknown file: `n`
  9680:18-9680:29    warning  Link to unknown file: `625000`
  9682:9-9682:15     warning  Link to unknown file: `n`
  9682:59-9682:72    warning  Link to unknown file: `(2·i-1)!`
  9683:7-9683:14     warning  Link to unknown file: `i!`
  9684:29-9684:38    warning  Link to unknown file: `10%5E3`
  9684:49-9684:58    warning  Link to unknown file: `10%5E9`
  9686:10-9686:20    warning  Link to unknown file: `10%5E18`
  11369:9-11369:15   warning  Link to unknown file: `N`
  11370:9-11370:15   warning  Link to unknown file: `N`
  11370:19-11370:27  warning  Link to unknown file: `p`
  11372:10-11372:21  warning  Link to unknown file: `10%5E14`
  11374:11-11374:19  warning  Link to unknown file: `100`
  11743:18-11743:27  warning  Link to unknown file: `1,%203`
  11746:10-11746:19  warning  Link to unknown file: `1,%203`
  11746:24-11746:33  warning  Link to unknown file: `3,%203`
  11747:43-11747:52  warning  Link to unknown file: `3,%203`
  11770:9-11770:15   warning  Link to unknown file: `k`
  11772:17-11772:25  warning  Link to unknown file: `6`
  11772:29-11772:38  warning  Link to unknown file: `75`
  11772:42-11772:51  warning  Link to unknown file: `89`
  11772:55-11772:65  warning  Link to unknown file: `226`
  11776:5-11776:11   warning  Link to unknown file: `a`
  11776:15-11776:21  warning  Link to unknown file: `b`
  11776:25-11776:31  warning  Link to unknown file: `c`
  11776:35-11776:41  warning  Link to unknown file: `d`
  11779:7-11779:13   warning  Link to unknown file: `a`
  11779:17-11779:23  warning  Link to unknown file: `b`
  11779:27-11779:33  warning  Link to unknown file: `c`
  11779:37-11779:43  warning  Link to unknown file: `d`
  11977:9-11977:15   warning  Link to unknown file: `n`
  11979:5-11979:12   warning  Link to unknown file: `10`
  11980:5-11980:14   warning  Link to unknown file: `2100`
  11981:5-11981:18   warning  Link to unknown file: `2496144`
  11983:37-11983:48  warning  Link to unknown file: `C(n,r)`

⚠ 41 warnings

Those line numbers are problems 211, 230, 383, 444, 460, 461 and 468.

As remark-validate-links doesnt detect all of them, I looked for an error in remark-lint which might help. Unfortunately, it cant smell this problem very accurately.

remark-lint's current output for Problem 149 (which remark-validate-links doesnt detect) shows

  3622:1-3623:12       warning  Don’t use multiple top level headings (3622:1)            no-multiple-toplevel-headings
     3626:1            warning  Remove 1 line before node                                 no-consecutive-blank-lines
  3630:1-3638:52       warning  Code blocks should be fenced                              code-block-style
  3645:21-3645:24      warning  Found reference to undefined definition                   no-undefined-references
  3645:21-3645:24      warning  Use the trailing [] on reference links                    no-shortcut-reference-link
  3645:27-3645:57      warning  Use the trailing [] on reference links                    no-shortcut-reference-link
  3645:27-3645:57      warning  Found reference to undefined definition                   no-undefined-references
  3647:27-3647:30      warning  Use the trailing [] on reference links                    no-shortcut-reference-link
  3647:27-3647:30      warning  Found reference to undefined definition                   no-undefined-references
  3647:35-3647:41      warning  Use the trailing [] on reference links                    no-shortcut-reference-link
  3647:35-3647:41      warning  Found reference to undefined definition                   no-undefined-references
  3647:45-3647:51      warning  Use the trailing [] on reference links                    no-shortcut-reference-link
  3647:45-3647:51      warning  Found reference to undefined definition                   no-undefined-references
  3650:11-3650:15      warning  Found reference to undefined definition                   no-undefined-references
  3650:11-3650:15      warning  Use the trailing [] on reference links                    no-shortcut-reference-link
  3650:31-3650:36      warning  Found reference to undefined definition                   no-undefined-references
  3650:31-3650:36      warning  Use the trailing [] on reference links                    no-shortcut-reference-link
     3660:1            warning  Remove 1 line before node                                 no-consecutive-blank-lines
  3663:1-3664:12       warning  Headings should use atx                                   heading-style
     3663:1            warning  Remove 1 line before node                                 no-consecutive-blank-lines

So, no-shortcut-reference-link and no-undefined-references are likely the two codes we need to enable to prevent new cases arising, however that will involve a lot of changes as those codes cover much more than just these invalid links according to github.

$ remark -u lint README.md 2>&1 | grep '[-]reference' |wc -l
1612

Anyway, patch coming soon for this among with a long series of itemised patches.

@jayvdb jayvdb mentioned this issue Jun 29, 2016
jayvdb added a commit to jayvdb/PocketEuler that referenced this issue Jul 9, 2016
Github is creating links to non-existant resources
due to the presence of `[..] (..)` syntax.  Github
allows a space between these components, while the
space avoids links in other markdown parsers.

These mostly occurred because `[..]` is being used
to denote subscript within equations.

Replace these equations with LaTeX, and add
`\hspace{0pt}` between any literal square brackets
and round brackets to prevent links.

Also add missing sum in equations for problem 444,
and remove a stray `^` from problem 461.

Fixes imsky#3
jayvdb added a commit to jayvdb/PocketEuler that referenced this issue Jul 9, 2016
Github is creating links to non-existant resources
due to the presence of `[..] (..)` syntax.  Github
allows a space between these components, while the
space avoids links in other markdown parsers.

These mostly occurred because `[..]` is being used
to denote subscript within equations.

Replace these equations with LaTeX, and add
`\hspace{0pt}` between any literal square brackets
and round brackets to prevent links.

Also add missing sum in equations for problem 444,
and remove a stray `^` from problem 461.

Fixes imsky#3
jayvdb added a commit to jayvdb/PocketEuler that referenced this issue Jul 9, 2016
Github is creating links to non-existant resources
due to the presence of `[..] (..)` syntax.  Github
allows a space between these components, while the
space avoids links in other markdown parsers.

These mostly occurred because `[..]` is being used
to denote subscript within equations.

Replace these equations with LaTeX, and add
`\hspace{0pt}` between any literal square brackets
and round brackets to prevent links.

Also add missing sum in equations for problem 444,
and remove a stray `^` from problem 461.

Fixes imsky#3
jayvdb added a commit to jayvdb/PocketEuler that referenced this issue Jul 9, 2016
Github is creating links to non-existant resources
due to the presence of `[..] (..)` syntax.  Github
allows a space between these components, while the
space avoids links in other markdown parsers.

These mostly occurred because `[..]` is being used
to denote subscript within equations.

Replace these equations with LaTeX, and add
`\hspace{0pt}` between any literal square brackets
and round brackets to prevent links.

Also add missing sum in equations for problem 444,
and remove a stray `^` from problem 461.

Fixes imsky#3
jayvdb added a commit to jayvdb/PocketEuler that referenced this issue Jul 9, 2016
Github is creating links to non-existant resources
due to the presence of `[..] (..)` syntax.  Github
allows a space between these components, while the
space avoids links in other markdown parsers.

These mostly occurred because `[..]` is being used
to denote subscript within equations.

Replace these equations with LaTeX, and add
`\hspace{0pt}` between any literal square brackets
and round brackets to prevent links.

Also add missing sum in equations for problem 444,
and remove a stray `^` from problem 461.

Fixes imsky#3
jayvdb added a commit to jayvdb/PocketEuler that referenced this issue Jul 9, 2016
Github is creating links to non-existant resources
due to the presence of `[..] (..)` syntax.  Github
allows a space between these components, while the
space avoids links in other markdown parsers.

These mostly occurred because `[..]` is being used
to denote subscript within equations.

Replace these equations with LaTeX, and add
`\hspace{0pt}` between any literal square brackets
and round brackets to prevent links.

Also add missing sum in equations for problem 444,
and remove a stray `^` from problem 461.

Fixes imsky#3
jayvdb added a commit to jayvdb/PocketEuler that referenced this issue Jul 9, 2016
Github is creating links to non-existant resources
due to the presence of `[..] (..)` syntax.  Github
allows a space between these components, while the
space avoids links in other markdown parsers.

These mostly occurred because `[..]` is being used
to denote subscript within equations.

Replace these equations with LaTeX, and add
`\hspace{0pt}` between any literal square brackets
and round brackets to prevent links.

Also add missing sum in equations for problem 444,
and remove a stray `^` from problem 461.

Fixes imsky#3
@jayvdb jayvdb closed this as completed in #51 Jul 9, 2016
jayvdb added a commit that referenced this issue Jul 9, 2016
Remove invalid references due to syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants