mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
remove last script tag
This commit is contained in:
parent
fee5e3064e
commit
638f48c2fc
2 changed files with 3 additions and 5 deletions
|
@ -8,11 +8,8 @@ export default function setup(parser: Parser): void {
|
|||
const content_start = parser.index;
|
||||
const setupScriptContent = parser.read_until(/^---/m);
|
||||
const content_end = parser.index;
|
||||
console.log(setupScriptContent);
|
||||
parser.eat('---', true);
|
||||
const end = parser.index;
|
||||
|
||||
console.log('XXX', parser.template.slice(end));
|
||||
parser.js.push({
|
||||
type: 'Script',
|
||||
context: 'setup',
|
||||
|
|
|
@ -79,13 +79,14 @@ async function convertMdToJsx(
|
|||
// Break it up here so that the HTML parser won't detect it.
|
||||
const stringifiedSetupContext = JSON.stringify(setupContext).replace(/\<\/script\>/g, `</scrip" + "t>`);
|
||||
|
||||
const raw = `<script astro>
|
||||
const raw = `---
|
||||
${imports}
|
||||
${_frontmatterData.layout ? `export const layout = ${JSON.stringify(_frontmatterData.layout)};` : ''}
|
||||
export function setup({context}) {
|
||||
return {context: ${stringifiedSetupContext} };
|
||||
}
|
||||
</script><section>${mdHtml}</section>`;
|
||||
---
|
||||
<section>${mdHtml}</section>`;
|
||||
|
||||
const convertOptions = { compileOptions, filename, fileID };
|
||||
|
||||
|
|
Loading…
Reference in a new issue