pantsdown 1.1.0 → 1.1.2

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.1.0",
3
+ "version": "1.1.2",
4
4
  "author": "wallpants",
5
5
  "description": "The markdown parser",
6
6
  "license": "MIT",
package/src/parser.ts CHANGED
@@ -71,7 +71,7 @@ export class Parser {
71
71
  sourceMapLineStart ? sourceMapLineStart + 2 + j : undefined,
72
72
  );
73
73
  }
74
- out += this.renderer.table(header, body, token.sourceMap);
74
+ out += this.renderer.table(header, body);
75
75
  continue;
76
76
  }
77
77
  case "blockquote": {
package/src/renderer.ts CHANGED
@@ -80,17 +80,9 @@ export class Renderer {
80
80
  return `<p${renderSourceMap(sourceMap)}>${text}</p>\n`;
81
81
  }
82
82
 
83
- table(header: string, body: string, sourceMap: SourceMap): string {
83
+ table(header: string, body: string): string {
84
84
  if (body) body = `<tbody>${body}</tbody>`;
85
-
86
- return (
87
- `<table${renderSourceMap(sourceMap)}>\n` +
88
- "<thead>\n" +
89
- header +
90
- "</thead>\n" +
91
- body +
92
- "</table>\n"
93
- );
85
+ return "<table>\n" + "<thead>\n" + header + "</thead>\n" + body + "</table>\n";
94
86
  }
95
87
 
96
88
  tablerow(content: string, sourceMapStart: number | undefined): string {
package/src/tokenizer.ts CHANGED
@@ -103,7 +103,7 @@ export class Tokenizer {
103
103
  const cap = block.blockquote.exec(src);
104
104
  if (!cap) return undefined;
105
105
 
106
- const text = cap[0].replace(/^ *>[ \t]?/gm, "");
106
+ const text = rtrim(cap[0].replace(/^ *>[ \t]?/gm, ""), "\n");
107
107
  const top = this.lexer.state.top;
108
108
  this.lexer.state.top = true;
109
109
  const tokens = this.lexer.blockTokens(text, []);