forked from GitbookIO/gitbook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore empty articles, and be more flexible in parsing articles (Gitb…
…ookIO#1741) * Ignore empty articles, and be more flexible in parsing articles * gitbook: Update markup-it^3.4.0
- Loading branch information
Showing
5 changed files
with
198 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
packages/gitbook/src/parse/__tests__/fixtures/summary/flexible.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
nodes: | ||
- kind: block | ||
type: header_one | ||
nodes: | ||
- kind: text | ||
text: Summary | ||
- kind: block | ||
type: unordered_list | ||
nodes: | ||
- kind: block | ||
type: list_item | ||
nodes: | ||
- kind: block | ||
type: unstyled | ||
nodes: | ||
- kind: text | ||
text: 'ignored text' | ||
- kind: inline | ||
type: link | ||
data: | ||
href: 'art1.md' | ||
nodes: | ||
- kind: text | ||
text: 'Article 1' | ||
- kind: text | ||
text: '' | ||
|
||
- kind: block | ||
type: list_item | ||
nodes: | ||
- kind: block | ||
type: paragraph | ||
nodes: | ||
- kind: text | ||
text: 'Article 2' | ||
- kind: block | ||
type: paragraph | ||
nodes: | ||
- kind: text | ||
text: 'Ignored' | ||
|
||
- kind: block | ||
type: list_item | ||
nodes: | ||
- kind: block | ||
type: paragraph | ||
nodes: | ||
- kind: text | ||
text: 'First paragraph. There is a link further, so should be ignored' | ||
|
||
# Sublist, that is not after a link. Should be ignored | ||
- kind: block | ||
type: unordered_list | ||
nodes: | ||
- kind: block | ||
type: list_item | ||
nodes: | ||
- kind: block | ||
type: unstyled | ||
nodes: | ||
- kind: inline | ||
type: link | ||
data: | ||
href: 'ignored.md' | ||
nodes: | ||
- kind: text | ||
text: 'Ignored' | ||
|
||
- kind: block | ||
type: paragraph | ||
nodes: | ||
- kind: inline | ||
type: link | ||
data: | ||
href: 'art3.md' | ||
nodes: | ||
- kind: text | ||
text: 'Article 3' | ||
|
||
# First sublist that is after the link. Parsed as subarticles | ||
- kind: block | ||
type: unordered_list | ||
nodes: | ||
- kind: block | ||
type: list_item | ||
nodes: | ||
- kind: block | ||
type: unstyled | ||
nodes: | ||
- kind: inline | ||
type: link | ||
data: | ||
href: 'art2.1.md' | ||
nodes: | ||
- kind: text | ||
text: 'Article 2.1' | ||
|
||
# Ignored because we already parsed the previous list | ||
- kind: block | ||
type: unordered_list | ||
nodes: | ||
- kind: block | ||
type: list_item | ||
nodes: | ||
- kind: block | ||
type: unstyled | ||
nodes: | ||
- kind: inline | ||
type: link | ||
data: | ||
href: 'ignored' | ||
nodes: | ||
- kind: text | ||
text: 'ignored' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters