将 GFM 高亮代码块转换为 Stack Overflow 高亮代码块
Convert GFM highlighted code block to Stack Overflow highlighted code block
1。问题
我无法转换 GFM highlighted code block to Stack Overflow highlighted code block。
2。例子
比如我需要转换:
Do not change this line
```markdown
Sasha great!
Sasha nice!
She is beautiful, surprise!
```
Do not change this line
至:
Do not change this line
<!-- language: lang-markdown -->
Sasha great!
Sasha nice!
She is beautiful, surprise!
Do not change this line
3。问题
为了突出显示代码块,我需要在代码块内的每一行的开头添加制表符。我不明白,我怎么能做到。
4。没有帮助
我的示例正则表达式:
查找:
\`\`\`(.+?)\n((.+?\n)+)\`\`\`
替换:
<!-- language: lang- -->\n\n\t
我得到结果:
Do not change this line
<!-- language: lang-markdown -->
Sasha great!
Sasha nice!
She is beautiful, surprise!
Do not change this line
仅在代码块内的第一行开头添加制表符号。我该怎么做,在代码块内的每一行的开头添加制表符?
1。问题
我无法转换 GFM highlighted code block to Stack Overflow highlighted code block。
2。例子
比如我需要转换:
Do not change this line
```markdown
Sasha great!
Sasha nice!
She is beautiful, surprise!
```
Do not change this line
至:
Do not change this line
<!-- language: lang-markdown -->
Sasha great!
Sasha nice!
She is beautiful, surprise!
Do not change this line
3。问题
为了突出显示代码块,我需要在代码块内的每一行的开头添加制表符。我不明白,我怎么能做到。
4。没有帮助
我的示例正则表达式:
查找:
\`\`\`(.+?)\n((.+?\n)+)\`\`\`
替换:
<!-- language: lang- -->\n\n\t
我得到结果:
Do not change this line
<!-- language: lang-markdown -->
Sasha great!
Sasha nice!
She is beautiful, surprise!
Do not change this line
仅在代码块内的第一行开头添加制表符号。我该怎么做,在代码块内的每一行的开头添加制表符?