Skip to content

Commit 547cf91

Browse files
fix issue with headings not being parsed correctly (#71)
2 parents 0ede628 + a0a8a15 commit 547cf91

File tree

12 files changed

+1347
-494
lines changed

12 files changed

+1347
-494
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
### [WFE-XXX]
22

33
### Description
4+
45
<!-- Please summarize **all** changes introduced in this PR. Add explanations where needed. -->
56

67
### Manual PR Checklist
78

8-
- [ ] CHANGELOG entry added
99
- [ ] Test coverage added
1010
- [ ] Licenses checked
1111
- [ ] All related Jira tickets added to PR title

CHANGELOG.md

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,3 @@
11
# Changelog
22

3-
All notable changes to this project will be documented in this file.
4-
5-
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6-
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7-
8-
## Unreleased
9-
10-
### Added
11-
12-
- [[WFE-267]](https://labforward.atlassian.net/browse/WFE-267) [Deployment & Maintenance] Set up tests in CI
13-
- [[WFE-266]](https://labforward.atlassian.net/browse/WFE-264) [Deployment & Maintenance] Create TS build config that produces ESModule-compliant output
14-
- [[WFE-264]](https://labforward.atlassian.net/browse/WFE-264) [Deployment & Maintenance] Extract LO Markdown parser into separate package
15-
16-
### Changed
17-
18-
- [[WFE-303]](https://labforward.atlassian.net/browse/WFE-303) [Deployment & Maintenance] Rewrite Markdown parser extensions to work in Webpack dev mode
19-
20-
### Deprecated
21-
22-
### Removed
23-
24-
### Fixed
25-
26-
### Security
3+
The changelog is now kept with each [Github Release](https://github.com/labforward/laboperator-markdown-parser/releases).

dist/md2hast.js

Lines changed: 15 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/md2hast.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@
5151
"unified": "^10.1.2"
5252
},
5353
"devDependencies": {
54-
"@labforward/config": "^0.1.0",
55-
"@labforward/eslint-config-node": "^0.1.0",
54+
"@babel/core": "^7.21.0",
55+
"@labforward/config": "~0.1.0",
56+
"@labforward/eslint-config-node": "~0.1.0",
5657
"@types/jest": "^29.4.0",
5758
"@types/lodash": "^4.14.191",
59+
"@types/node": "^18.14.1",
5860
"del-cli": "^5.0.0",
5961
"eslint": "^8.35.0",
6062
"husky": "^8.0.3",

src/__snapshots__/spec.test.ts.snap renamed to src/__snapshots__/extensions.spec.ts.snap

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,69 @@ exports[`Markdown extensions for grid add support for parsing custom grid syntax
924924
}
925925
`;
926926

927+
exports[`Markdown extensions for grid ignores incorrect grid like content 1`] = `
928+
{
929+
"children": [
930+
{
931+
"children": [
932+
{
933+
"position": {
934+
"end": {
935+
"column": 6,
936+
"line": 6,
937+
"offset": 42,
938+
},
939+
"start": {
940+
"column": 1,
941+
"line": 1,
942+
"offset": 0,
943+
},
944+
},
945+
"type": "text",
946+
"value": "% col
947+
orful
948+
%clo
949+
wn drinking
950+
%co
951+
fee",
952+
},
953+
],
954+
"position": {
955+
"end": {
956+
"column": 6,
957+
"line": 6,
958+
"offset": 42,
959+
},
960+
"start": {
961+
"column": 1,
962+
"line": 1,
963+
"offset": 0,
964+
},
965+
},
966+
"properties": {},
967+
"tagName": "p",
968+
"type": "element",
969+
},
970+
],
971+
"data": {
972+
"quirksMode": false,
973+
},
974+
"position": {
975+
"end": {
976+
"column": 1,
977+
"line": 1,
978+
"offset": 0,
979+
},
980+
"start": {
981+
"column": 1,
982+
"line": 1,
983+
"offset": 0,
984+
},
985+
},
986+
"type": "root",
987+
}
988+
`;
989+
927990
exports[`Markdown extensions for grid is able to parse deeply nested grid 1`] = `
928991
{
929992
"children": [
@@ -2285,6 +2348,64 @@ exports[`Markdown extensions for interpolation add support for interpolation syn
22852348
}
22862349
`;
22872350

2351+
exports[`Markdown extensions for interpolation ignores unmatched brackets 1`] = `
2352+
{
2353+
"children": [
2354+
{
2355+
"children": [
2356+
{
2357+
"position": {
2358+
"end": {
2359+
"column": 33,
2360+
"line": 1,
2361+
"offset": 32,
2362+
},
2363+
"start": {
2364+
"column": 1,
2365+
"line": 1,
2366+
"offset": 0,
2367+
},
2368+
},
2369+
"type": "text",
2370+
"value": "{{f} {f} {{f !{{f} !{f} !{{f",
2371+
},
2372+
],
2373+
"position": {
2374+
"end": {
2375+
"column": 33,
2376+
"line": 1,
2377+
"offset": 32,
2378+
},
2379+
"start": {
2380+
"column": 1,
2381+
"line": 1,
2382+
"offset": 0,
2383+
},
2384+
},
2385+
"properties": {},
2386+
"tagName": "p",
2387+
"type": "element",
2388+
},
2389+
],
2390+
"data": {
2391+
"quirksMode": false,
2392+
},
2393+
"position": {
2394+
"end": {
2395+
"column": 1,
2396+
"line": 1,
2397+
"offset": 0,
2398+
},
2399+
"start": {
2400+
"column": 1,
2401+
"line": 1,
2402+
"offset": 0,
2403+
},
2404+
},
2405+
"type": "root",
2406+
}
2407+
`;
2408+
22882409
exports[`Markdown extensions for interpolation works inside explicit markdown table 1`] = `
22892410
{
22902411
"children": [

0 commit comments

Comments
 (0)