Skip to content

Commit

Permalink
fix: do not modify source markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
gera2ld committed Dec 3, 2023
1 parent f330940 commit 823806c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Node >= 12
Node >= 16
2 changes: 0 additions & 2 deletions .babelrc.js → babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ module.exports = {
presets: [
'@babel/preset-typescript',
],
plugins: [
].filter(Boolean),
};
10 changes: 1 addition & 9 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { readPackageUp } from 'read-pkg-up';
import plaid from '@gera2ld/plaid';
import pkg from './package.json' assert { type: 'json' };

const { defaultOptions, getRollupExternal, getRollupPlugins, loadConfigSync } =
const { defaultOptions, getRollupExternal, getRollupPlugins } =
plaid;

async function getVersion(module) {
Expand All @@ -26,19 +26,11 @@ export default async () => {
};

const external = getRollupExternal(['path', 'vscode']);
const postcssConfig =
loadConfigSync('postcss') ||
(await import('@gera2ld/plaid/config/postcssrc.js'));
const postcssOptions = {
...postcssConfig,
inject: false,
};
const rollupConfig = [
{
input: 'src/extension.ts',
plugins: getRollupPlugins({
extensions: defaultOptions.extensions,
postcss: postcssOptions,
replaceValues,
}),
external,
Expand Down
3 changes: 1 addition & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ class MarkmapEditor implements CustomTextEditorProvider {
},
});
if (!targetUri) return;
let md = document.getText();
md = md.replace(/\r\n?/g, '\n');
const md = document.getText();
const { root, features, frontmatter } = transformerExport.transform(md);
const jsonOptions = {
...defaultOptions,
Expand Down

0 comments on commit 823806c

Please sign in to comment.