Skip to content

Commit db82d88

Browse files
committed
fix code/noformat rendering
1 parent 0707122 commit db82d88

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/markupParser.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) {
143143
return `<pre><code style='font-family: ${MONOSPACE_FONT_FAMILY}'>${m2.replace(/</gi, '&lt;')}</code></pre>`;
144144
});
145145

146-
const code_re = /\{[(code)|(noformat)].*\}/;
146+
const code_re = /\{(noformat)|(code)[^}]*\}/;
147147
const code_match = tag.match(code_re);
148148
if (code_match) {
149149
if (! codeTagFlag) {
@@ -156,8 +156,8 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) {
156156
}
157157

158158
const panel_re = /\{panel(.*)}/;
159-
if (tag.match(panel_re)) {
160-
if (! panelTagFlag) {
159+
if (! codeTagFlag && tag.match(panel_re)) {
160+
if (! panelTagFlag ) {
161161
let panelStyle = "";
162162
let titleStyle = "";
163163
tag = tag.replace(panel_re, function (m0, m1) {

0 commit comments

Comments
 (0)