the transformer trigger regex should remove the language comment character

This commit is contained in:
Elijah 2024-10-04 16:36:13 +00:00
parent 4ba277cea5
commit 89b3891be8

View File

@ -782,10 +782,10 @@ class ShikiHighLevelCodeBlock(ShikiCodeBlock):
if isinstance(code, Var):
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):
return re.sub(r"// \[!code.*?\]", "", code)
return re.sub(r"[\/#]+ *\[!code.*?\]", "", code)
class TransformerNamespace(ComponentNamespace):