pantsdown 1.4.3 → 1.4.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantsdown",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "author": "wallpants",
5
5
  "description": "Markdown to 'GitHub HTML' parser",
6
6
  "license": "MIT",
package/src/parser.ts CHANGED
@@ -126,7 +126,7 @@ export class Parser {
126
126
  itemBody,
127
127
  task,
128
128
  Boolean(checked),
129
- token.sourceMap![0] + j,
129
+ token.sourceMap ? token.sourceMap[0] + j : undefined,
130
130
  );
131
131
  }
132
132
 
package/src/renderer.ts CHANGED
@@ -106,12 +106,17 @@ export class Renderer {
106
106
  );
107
107
  }
108
108
 
109
- listitem(text: string, task: boolean, _checked: boolean, lineStart: number): string {
109
+ listitem(
110
+ text: string,
111
+ task: boolean,
112
+ _checked: boolean,
113
+ lineStart: number | undefined,
114
+ ): string {
110
115
  const classes: string[] = [];
111
116
  if (task) classes.push("task-list-item");
112
- return `<li${renderHtmlClasses(
113
- classes,
114
- )} line-start="${lineStart}" line-end="${lineStart}">${text}</li>\n`;
117
+ return `<li${renderHtmlClasses(classes)}${renderSourceMap(
118
+ lineStart ? [lineStart, lineStart] : undefined,
119
+ )}>${text}</li>\n`;
115
120
  }
116
121
 
117
122
  checkbox(checked: boolean, classes: string[] = []): string {