markdown_link_checker_sc 0.0.13 → 0.0.116

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +66 -12
  2. package/biglog.txt +0 -0
  3. package/index.js +181 -435
  4. package/package.json +6 -1
  5. package/src/errors.js +148 -0
  6. package/src/helpers.js +41 -0
  7. package/src/links.js +194 -0
  8. package/src/output_errors.js +49 -0
  9. package/src/process_image_orphans.js +97 -0
  10. package/src/process_internal_url_links.js +20 -0
  11. package/src/process_local_image_links.js +57 -0
  12. package/src/process_markdown.js +400 -0
  13. package/src/process_orphans.js +145 -0
  14. package/src/process_relative_links.js +116 -0
  15. package/src/shared_data.js +2 -0
  16. package/src/slugify.js +17 -0
  17. package/tests/errortype/current_file_missing_anchor/heading_present_for_anchor.md +13 -0
  18. package/tests/errortype/current_file_missing_anchor/missing_heading.md +5 -0
  19. package/tests/errortype/linked_file_missing_anchor/file_with_broken_heading_link.md +10 -0
  20. package/tests/errortype/linked_file_missing_anchor/file_without_heading.md +10 -0
  21. package/tests/errortype/linked_internal_file_html/file_exists.html +5 -0
  22. package/tests/errortype/linked_internal_file_html/file_exists_as_markdown.md +6 -0
  23. package/tests/errortype/linked_internal_file_html/links_to_file_that_is_html.md +10 -0
  24. package/tests/errortype/linked_internal_file_missing/file_present_relative_link_no_error.md +5 -0
  25. package/tests/errortype/linked_internal_file_missing/file_present_should_be_no_error.md +5 -0
  26. package/tests/errortype/linked_internal_file_missing/links_to_file_that_is_not_present.md +8 -0
  27. package/tests/errortype/local_image_not_found/page_with_missing_image.md +9 -0
  28. package/tests/errortype/local_image_not_found/test.png +0 -0
  29. package/tests/errortype/orphan_images/assets/image1_not_linked.png +0 -0
  30. package/tests/errortype/orphan_images/assets/image2_not_linked.png +0 -0
  31. package/tests/errortype/orphan_images/test/image3_not_linked.png +0 -0
  32. package/tests/errortype/orphan_images/test/image4_linked.png +0 -0
  33. package/tests/errortype/orphan_images/test/intro.md +11 -0
  34. package/tests/errortype/page_not_in_toc/page1intoc_should_not_error.md +7 -0
  35. package/tests/errortype/page_not_in_toc/page2intoc_should_not_error.md +7 -0
  36. package/tests/errortype/page_not_in_toc/page3NOTinTOC.md +7 -0
  37. package/tests/errortype/page_not_in_toc/toc.md +9 -0
  38. package/tests/errortype/url_to_local_site/mylocalsite_dot_com.md +8 -0
  39. package/tests/links/tests1.md +93 -0
  40. package/tests/links/tests2.md +3 -0
  41. package/tests/tests1.md +0 -42
@@ -0,0 +1,10 @@
1
+ # Tests if error shows when linked file has no matching heading
2
+
3
+ Run like: `node .\index.js -d tests/errortype/linked_file_missing_anchor`
4
+
5
+ - [Url to file exists but no matching "heading to match"](file_without_heading.md#heading-to-match-that_doesnt_exist) yeah!
6
+
7
+ - [Matched heading for anchor exists: should not show error](file_without_heading.md#cool-matched-heading-for-anchor-link)
8
+
9
+
10
+ - Link to id?
@@ -0,0 +1,10 @@
1
+ # Target file for test of ids/headings being present (they are not)
2
+
3
+ Run like: `node .\index.js -d tests/errortype/linked_file_missing_anchor`
4
+
5
+ This is a target
6
+
7
+
8
+ ## Cool matched heading for anchor link
9
+
10
+ Yeah
@@ -0,0 +1,5 @@
1
+ <!DOCTYPE html>
2
+ <!-- saved from url=(0049)https://streams.spec.whatwg.org/#example-rbs-push -->
3
+ <html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4
+
5
+ </html>
@@ -0,0 +1,6 @@
1
+ # This file is referenced incorrectly as an html file
2
+
3
+ This should warn us that we got the name wrong.
4
+
5
+ Run like: `node .\index.js -d tests/errortype/linked_internal_file_html`
6
+
@@ -0,0 +1,10 @@
1
+ # Tests if error shows when linked file has no matching heading
2
+
3
+ Run like: `node .\index.js -d tests/errortype/linked_internal_file_html`
4
+
5
+ - [Url to HTML file that exists - but has no matching heading (we probably don't do anchors in HTML yet)](file_exists.html#heading-to-match) yeah!
6
+
7
+ - [Url to HTML file that does not exists - show missing file error](file_not_exists.html#heading-to-match) yeah!
8
+
9
+
10
+ - [Url to HTML file that does not exists but markdown does - show appropriate error](file_exists_as_markdown.html#heading-to-match) yeah!
@@ -0,0 +1,5 @@
1
+ # Test file - used to show no error happens for linked file with relative link
2
+
3
+ Run like: `node .\index.js -d tests/errortype/linked_internal_file_missing`
4
+
5
+
@@ -0,0 +1,5 @@
1
+ # Test file - used to show no error happens for linked file in same directory
2
+
3
+ Run like: `node .\index.js -d tests/errortype/linked_internal_file_missing`
4
+
5
+
@@ -0,0 +1,8 @@
1
+ # Tests if error shows when linked file has no matching heading
2
+
3
+ Run like: `node .\index.js -d tests/errortype/linked_internal_file_missing`
4
+
5
+ - [Url to missing file - show missing file error](file_no_exists.md#heading-to-match)
6
+ - [Url to present file in same directory - should be no error](file_present_should_be_no_error.md)
7
+ - [Url to present file linked relative - should be no error](../linked_internal_file_missing/file_present_relative_link_no_error.md)
8
+
@@ -0,0 +1,9 @@
1
+ # Tests if linked images not in file system show up as errors
2
+
3
+ Run like: `node .\index.js -d tests/errortype/local_image_not_found`
4
+
5
+ This has links to images that exist/don't exist in file system
6
+
7
+ - ![Missing JPG 1 - should show as error](missing_jpg1.jpg)
8
+ - ![Missing PNG 1 - should show as error](missing_png1.png)
9
+ - ![Present PNG - should NOT show as error](test.png)
@@ -0,0 +1,11 @@
1
+ # Tests if missing page in toc throws error (test page is in toc)
2
+
3
+ Run like:
4
+ - `node .\index.js -d tests/errortype/orphan_images/test`
5
+ - should just pick up "\test\image3_not_linked.png"
6
+ - `node .\index.js -d tests/errortype/orphan_images/test -i tests/errortype/orphan_images/assets`
7
+ - should pick up "\test\image3_not_linked.png", \assets\image1_not_linked.png, \assets\image2_not_linked.png
8
+
9
+
10
+
11
+ - ![Image 4 is linked - should not show error](image4_linked.png)
@@ -0,0 +1,7 @@
1
+ # Tests if missing page in toc throws error (test page is in toc)
2
+
3
+ Run like: `node .\index.js -d tests/errortype/url_to_local_site -u mylocalsite.com`
4
+
5
+ This page is in toc.
6
+
7
+ This page is in the toc 1
@@ -0,0 +1,7 @@
1
+ # Tests if missing page in toc throws error (test page is in toc)
2
+
3
+ Run like: `node .\index.js -d tests/errortype/url_to_local_site -u mylocalsite.com`
4
+
5
+ This page is in toc.
6
+
7
+ This page is in the toc 1
@@ -0,0 +1,7 @@
1
+ # Tests if missing page in toc throws error (test page is NOT in toc should error)
2
+
3
+ Run like: `node .\index.js -d tests/errortype/page_not_in_toc`
4
+
5
+ This page is in toc.
6
+
7
+ This page is in the toc 1
@@ -0,0 +1,9 @@
1
+ # Tests if a url to current site shows up as error
2
+
3
+ Run like: `node .\index.js -d tests/errortype/page_not_in_toc`
4
+
5
+ This is the TOC file. Links to two others. Those should not error
6
+
7
+ - [Page in TOC1](page1intoc_should_not_error.md)
8
+ - [Page in TOC2](page2intoc_should_not_error.md)
9
+
@@ -0,0 +1,8 @@
1
+ # Tests if a url to current site shows up as error
2
+
3
+ Run like: `node .\index.js -d tests/errortype/url_to_local_site -u mylocalsite.com`
4
+
5
+
6
+ This is URL to local site: [Url to local site in markdown](http://mylocalsite.com/somepage.md) space.
7
+
8
+ This is HTML URL to local site: <a href="http://mylocalsite.com/somepage.md">Url to local site as a tag</a> whatever.
@@ -0,0 +1,93 @@
1
+ # Heading One
2
+
3
+ [beer1](https://www.example.com/path/to/page.html?param1=value1#anchor1)
4
+
5
+ [beer2](https://www.example.com/path/to/page.html#anchor2?param1=value1)
6
+
7
+ [beer3](#anchor3?param1=value1)
8
+
9
+ [beer4](car.md#anchor4?param1=value1)
10
+
11
+ [beer5](../fred/car.md#anchor5?param1=value1)
12
+
13
+
14
+ [beer6](../fred/car.md#anchor5?param1=value1&param2=value2)
15
+
16
+ ## Heading Two
17
+
18
+
19
+
20
+
21
+ ## Image tests
22
+
23
+
24
+ <img src="../../assets/qgc/setup/sensor/sensor_orientation_set_orientations.jpg" style="width: 600px;"/>
25
+
26
+ ![image link text 1](../assets/image_link1.jpg)
27
+
28
+ ## Heading Two 1
29
+
30
+ ## Heading Two 2
31
+
32
+ This link not handled well
33
+
34
+ <a href="http://www.craftandtheoryllc.com/telemetry-cable"><img src="../../assets/hardware/telemetry/craft_and_theory_frsky_telemetry_cables.jpg" alt="Purchase cable here from Craft and Theory"></a>
35
+
36
+
37
+ ### Heading Three
38
+
39
+ #### Heading Four
40
+
41
+ ##### Heading Five
42
+
43
+ ###### Heading Six
44
+
45
+
46
+ ## Odd Named-+And*Chars`WorkedOUTER#~END
47
+
48
+ [Link Start Line](#heading-two-2) is a great one
49
+
50
+ A link in a line [Link inside a line](#anchor-to_this-page-inside_line) that is cool
51
+
52
+ A link enbd line [Link end line](#anchor-to_this-page-end-line)
53
+
54
+ [Link start line](#anchor-to_this-page-start-line) blah blah
55
+
56
+ Two links in line line [Link 1 or 2 in Line](#anchor--lin1-inlinkto_this-page-end-line) and [Link 2 In Line Line two](#anchor-link2-inlin=to_this-page-end-line2) fred
57
+
58
+
59
+ <a href="someurl1" title="some title1">somelink text1</a>
60
+
61
+ <a href="someurl2">somelink text2</a>
62
+
63
+ <a title="some title 3" href="some url3" >somelink text3</a>
64
+
65
+ dfsafd ![image link text 2](../assets/image_link2.jpg)
66
+
67
+ dfsafd ![Text with title](../assets/image_link2.jpg "title of the link1")
68
+
69
+
70
+ aa ![Text with title 2](../assets/image_link2.jpg "title of the link2" )
71
+
72
+ dfsafd @[vuepressYoutueUrl text](vuepressYoutueUrl)
73
+
74
+ Image in link [![Image in link - image title](../assets/image_in_link_imageurl.jpg)](../image_in_link_linkurl.md)
75
+
76
+ 'Here is an [example of an ![image](https://example.com/image.png)](https://example.com) around a link.'
77
+
78
+ 'This is a [link](https://example.com) and this is an ![image](https://example.com/image.png) and this is a [![image](https://example.com/image.png)](https://example.com)';
79
+
80
+ 'This a [text in link1 ![image1 text](https://example.com/image1.png) more text in link1](https://example1.com)) and another one [text in link2 ![image2 text](https://example.com/image2.png) more text in link2](https://example2.com) blah blah). Cabbage.
81
+
82
+
83
+ A [first test params](https://example.com/path/to/resource?param1=value1&param2=value2#anchor)
84
+
85
+ A [first test params](https://example.com/path/to/resource#secondanchor?paramd1=value1&param2=value2)
86
+
87
+ asfd [CBRK_VTOLARMING](../advanced_config/parameter_reference.md#CBRK_VTOLARMING) dfadf
88
+
89
+
90
+ [Internal link to missing heading in test2](test2.md#some-unikely-heading)
91
+
92
+
93
+ [Internal link to an html file](ffred.htm;#some-unikely-heading)
@@ -0,0 +1,3 @@
1
+ # Heading One
2
+
3
+ This has not heading #fred
package/tests/tests1.md DELETED
@@ -1,42 +0,0 @@
1
- # Heading One
2
-
3
- ## Heading Two
4
-
5
- ## Heading Two
6
-
7
- ## Heading Two 1
8
-
9
- ## Heading Two 2
10
-
11
-
12
- ### Heading Three
13
-
14
- #### Heading Four
15
-
16
- ##### Heading Five
17
-
18
- ###### Heading Six
19
-
20
-
21
- ## Odd Named-+And*Chars`WorkedOUTER#~END
22
-
23
- [Link Start Line](#heading-two-2) is a great one
24
-
25
- A link in aline [Link In Line Line](#heading-two-2) that is cool
26
-
27
- A link enbd line [Link In Line Line](#heading-two-2)
28
-
29
- A link enbd line [Link 1 In Line Line](#heading-two-2) and [Link 2 In Line Line two](#heading-two-2) fred
30
-
31
- ![image link](../assets/test.jpg)
32
-
33
- dfsafd ![image link](../assets/test.jpg)
34
- 90odsf
35
-
36
- Image in link [![image link](../assets/test.jpg)](#heading-two-2)
37
-
38
-
39
-
40
- PX4 supports numerous types of vehicles, including different configurations of multicopters, planes, VTOL vehicles, ground vehicles, etc. The complete set of supported configurations can be seen in the [Airframes Reference](../airframes/airframe_reference.md).
41
-
42
- This section contains instructions for how to install several different [flight controllers](../flight_controller/README.md) on a number of common frames.