Skip to content

Commit

Permalink
fix: sfc parse and format error
Browse files Browse the repository at this point in the history
  • Loading branch information
hikerpig committed Jan 21, 2019
1 parent e7c75ea commit c08ec65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion __tests__/__snapshots__/examples.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ exports[`examples examples/todo-app/TodoListItem.vue 1`] = `
"<template>
<li>
{ todo.text }
{{ todo.text }}
<button @click=\\"$emit('remove', todo.id)\\">
X
</button>
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ function formatContent(source, isSFC) {
if (isSFC) {
const res = parseComponent(source, { pad: 'line' })
return {
template: res.template.content.replace(/{{/g, '{').replace(/}}/g, '}'),
js: res.script.content.replace(/\/\//g, ''),
template: res.template.content,
js: res.script.content.replace(/\/\/\n/g, ''),
}
} else {
return {
Expand Down

0 comments on commit c08ec65

Please sign in to comment.