notion-to-md 1.0.4 → 1.0.5

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/notion-to-md.js CHANGED
@@ -97,7 +97,8 @@ ${md.addTabSpace(mdBlocks.parent, nestingLevel)}
97
97
  });
98
98
  }
99
99
 
100
- if (type === "code") parsedData = md.codeBlock(parsedData);
100
+ if (type === "code")
101
+ parsedData = md.codeBlock(parsedData, block[type].language);
101
102
  if (type === "heading_1") parsedData = md.heading1(parsedData);
102
103
  if (type === "heading_2") parsedData = md.heading2(parsedData);
103
104
  if (type === "heading_3") parsedData = md.heading3(parsedData);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notion-to-md",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "main": "notion-to-md.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/utils/md.js CHANGED
@@ -22,8 +22,8 @@ exports.link = (text, href) => {
22
22
  return `[${text}](${href})`;
23
23
  };
24
24
 
25
- exports.codeBlock = (text) => {
26
- return `\`\`\`
25
+ exports.codeBlock = (text, language) => {
26
+ return `\`\`\`${language}
27
27
  ${text}
28
28
  \`\`\``;
29
29
  };
@@ -41,7 +41,8 @@ exports.heading3 = (text) => {
41
41
  };
42
42
 
43
43
  exports.quote = (text) => {
44
- return `| ${text}`;
44
+ // the replace is done to handle multiple lines
45
+ return `> ${text.replace(/\n/g, " \n>")}`;
45
46
  };
46
47
 
47
48
  exports.bullet = (text) => {