Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dummy html line breaks cleanup #646

Merged
merged 2 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/resolvers/md2html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ export async function resolveMd2HTML(options: ResolverOptions): Promise<ResolveM
const transformFn: Function = FileTransformer[fileExtension];
const {result} = transformFn(content, {path: inputPath});

if (result.html) {
result.html = result.html.replace(/\n+/gm, '');
}

const updatedMetadata =
metadata && metadata.isContributorsEnabled
? await getUpdatedMetadata(metadata, content, result?.meta)
Expand Down
14 changes: 7 additions & 7 deletions tests/e2e/__snapshots__/load-custom-resources.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ exports[`Allow load custom resources md2html single page with custom resources 3
window.STATIC_CONTENT = false
window.__DATA__ = {"data":{"leading":false,"toc":{"title":"Documentation","href":"index.html","items":[{"name":"Documentation","href":"page.html","id":"Documentation-RANDOM"},{"name":"Config","href":"project/config.html","id":"Config-RANDOM"}],"base":"."},"meta":{"meta":"some meta","style":["_assets/style/test.css"],"script":["_assets/script/test1.js"]},"assets":[],"headings":[],"title":"","includes":[],"html":"
<p>Lorem
</p>"},"router":{"pathname":"page.html"},"lang":"ru"};
</p>/n"},"router":{"pathname":"page.html"},"lang":"ru"};
</script>
<script type="application/javascript"
src="_bundle/vendor.js"
Expand Down Expand Up @@ -162,7 +162,7 @@ exports[`Allow load custom resources md2html single page with custom resources 4
window.STATIC_CONTENT = false
window.__DATA__ = {"data":{"leading":false,"toc":{"title":"Documentation","href":"../index.html","items":[{"name":"Documentation","href":"../page.html","id":"Documentation-RANDOM"},{"name":"Config","href":"../project/config.html","id":"Config-RANDOM"}],"base":"."},"meta":{"style":["../_assets/style/test.css"],"script":["../_assets/script/test1.js"]},"assets":[],"headings":[],"title":"","includes":[],"html":"
<p>Lorem
</p>"},"router":{"pathname":"../project/config.html"},"lang":"ru"};
</p>/n"},"router":{"pathname":"../project/config.html"},"lang":"ru"};
</script>
<script type="application/javascript"
src="../_bundle/vendor.js"
Expand Down Expand Up @@ -219,10 +219,10 @@ exports[`Allow load custom resources md2html single page with custom resources 5
window.STATIC_CONTENT = false
window.__DATA__ = {"data":{"leading":false,"html":"
<p>Lorem
</p>
</p>/n
<hr class=\\"yfm-page__delimeter\\">
<p>Lorem
</p>","headings":[],"meta":{"style":["_assets/style/test.css"],"script":["_assets/script/test1.js"]},"toc":{"title":"Documentation","href":"index.yaml","items":[{"name":"Documentation","href":"#_page","id":"Documentation-RANDOM"},{"name":"Config","href":"#_project_config","id":"Config-RANDOM"}],"base":".","singlePage":true}},"router":{"pathname":"single-page.html"},"lang":"ru"};
</p>/n","headings":[],"meta":{"style":["_assets/style/test.css"],"script":["_assets/script/test1.js"]},"toc":{"title":"Documentation","href":"index.yaml","items":[{"name":"Documentation","href":"#_page","id":"Documentation-RANDOM"},{"name":"Config","href":"#_project_config","id":"Config-RANDOM"}],"base":".","singlePage":true}},"router":{"pathname":"single-page.html"},"lang":"ru"};
</script>
<script type="application/javascript"
src="_bundle/vendor.js"
Expand All @@ -240,7 +240,7 @@ exports[`Allow load custom resources md2html single page with custom resources 5
</html>
`;

exports[`Allow load custom resources md2html single page with custom resources 6`] = `"{"data":{"leading":false,"html":"<p>Lorem</p><hr class=\\"yfm-page__delimeter\\"><p>Lorem</p>","headings":[],"meta":{"style":["_assets/style/test.css"],"script":["_assets/script/test1.js"]},"toc":{"title":"Documentation","href":"index.yaml","items":[{"name":"Documentation","href":"#_page","id":"Documentation-RANDOM"},{"name":"Config","href":"#_project_config","id":"Config-RANDOM"}],"base":".","singlePage":true}},"router":{"pathname":"single-page.html"},"lang":"ru"}"`;
exports[`Allow load custom resources md2html single page with custom resources 6`] = `"{"data":{"leading":false,"html":"<p>Lorem</p>/n<hr class=\\"yfm-page__delimeter\\"><p>Lorem</p>/n","headings":[],"meta":{"style":["_assets/style/test.css"],"script":["_assets/script/test1.js"]},"toc":{"title":"Documentation","href":"index.yaml","items":[{"name":"Documentation","href":"#_page","id":"Documentation-RANDOM"},{"name":"Config","href":"#_project_config","id":"Config-RANDOM"}],"base":".","singlePage":true}},"router":{"pathname":"single-page.html"},"lang":"ru"}"`;

exports[`Allow load custom resources md2html with custom resources 1`] = `"["_assets/script/test1.js","_assets/style/test.css","_bundle/app.css","_bundle/app.js","_bundle/react.js","_bundle/vendor.css","_bundle/vendor.js","index.html","page.html","project/config.html"]"`;

Expand Down Expand Up @@ -347,7 +347,7 @@ exports[`Allow load custom resources md2html with custom resources 3`] = `
window.STATIC_CONTENT = false
window.__DATA__ = {"data":{"leading":false,"toc":{"title":"Documentation","href":"index.html","items":[{"name":"Documentation","href":"page.html","id":"Documentation-RANDOM"},{"name":"Config","href":"project/config.html","id":"Config-RANDOM"}],"base":"."},"meta":{"meta":"some meta","style":["_assets/style/test.css"],"script":["_assets/script/test1.js"]},"assets":[],"headings":[],"title":"","includes":[],"html":"
<p>Lorem
</p>"},"router":{"pathname":"page.html"},"lang":"ru"};
</p>/n"},"router":{"pathname":"page.html"},"lang":"ru"};
</script>
<script type="application/javascript"
src="_bundle/vendor.js"
Expand Down Expand Up @@ -404,7 +404,7 @@ exports[`Allow load custom resources md2html with custom resources 4`] = `
window.STATIC_CONTENT = false
window.__DATA__ = {"data":{"leading":false,"toc":{"title":"Documentation","href":"../index.html","items":[{"name":"Documentation","href":"../page.html","id":"Documentation-RANDOM"},{"name":"Config","href":"../project/config.html","id":"Config-RANDOM"}],"base":"."},"meta":{"style":["../_assets/style/test.css"],"script":["../_assets/script/test1.js"]},"assets":[],"headings":[],"title":"","includes":[],"html":"
<p>Lorem
</p>"},"router":{"pathname":"../project/config.html"},"lang":"ru"};
</p>/n"},"router":{"pathname":"../project/config.html"},"lang":"ru"};
</script>
<script type="application/javascript"
src="../_bundle/vendor.js"
Expand Down
Loading