Skip to content

Commit

Permalink
chore: format snippet cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Oct 11, 2020
1 parent 6eb973f commit eef214b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src-commons-ui/float-pane/SnippetView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export class SnippetView extends React.Component<Props, State> {
}
}


const regexPremeable = /^\s*<(\?|!)([a-zA-Z]+)?\s*/i
const regexLSPPrefix = /^\((method|property|parameter|alias)\)\W/

Expand Down Expand Up @@ -83,8 +82,10 @@ export async function getSnippetHtml(
snippets.forEach((snippet) => {
const preElem = document.createElement("pre")
const codeElem = document.createElement("code")
snippet = snippet.replace(regexPremeable, "") // remove any preamble from the line
codeElem.innerText = snippet.replace(regexLSPPrefix, "") // remove LSP prefix
snippet = snippet
.replace(regexPremeable, "") // remove any preamble from the line
.replace(regexLSPPrefix, "") // remove LSP prefix
codeElem.innerText = snippet
preElem.appendChild(codeElem)
divElem.appendChild(preElem)
})
Expand Down

0 comments on commit eef214b

Please sign in to comment.