the transformer trigger regex should remove the language comment character
This commit is contained in:
parent
4ba277cea5
commit
89b3891be8
@ -782,10 +782,10 @@ class ShikiHighLevelCodeBlock(ShikiCodeBlock):
|
|||||||
|
|
||||||
if isinstance(code, Var):
|
if isinstance(code, Var):
|
||||||
return string_replace_operation(
|
return string_replace_operation(
|
||||||
code, StringVar(_js_expr=r"/\/\/ \[!code.*?\]/g", _var_type=str), ""
|
code, StringVar(_js_expr=r"/[\/#]+ *\[!code.*?\]/g", _var_type=str), ""
|
||||||
)
|
)
|
||||||
if isinstance(code, str):
|
if isinstance(code, str):
|
||||||
return re.sub(r"// \[!code.*?\]", "", code)
|
return re.sub(r"[\/#]+ *\[!code.*?\]", "", code)
|
||||||
|
|
||||||
|
|
||||||
class TransformerNamespace(ComponentNamespace):
|
class TransformerNamespace(ComponentNamespace):
|
||||||
|
Loading…
Reference in New Issue
Block a user