I can't convert GFM highlighted code block to Stack Overflow highlighted code block.
For example, I need convert:
Do not change this line
```markdown
Sasha great!
Sasha nice!
She is beautiful, surprise!
```
Do not change this line
to:
Do not change this line
<!-- language: lang-markdown -->
Sasha great!
Sasha nice!
She is beautiful, surprise!
Do not change this line
That get highlighted code block, I need to add tab in beginning of each line inside code block. I don't understand, how I can do it.
my example regex:
Find:
\`\`\`(.+?)\n((.+?\n)+)\`\`\`
Replace:
<!-- language: lang-\1 -->\n\n\t\2
I get result:
Do not change this line
<!-- language: lang-markdown -->
Sasha great!
Sasha nice!
She is beautiful, surprise!
Do not change this line
Tabulation symbol added in beginning only for first line inside code block. What can I do, that add tab symbol in beginning of each line inside code block?
Since you are using Sublime Text find / replace functionality and there is no programming language involved it would take you about two steps to achieve what you desire.
For first step try to search for:
(?m)(?:^```\h*\S+\s+\K|\G(?!\A))^(?!```)(.*\R+)(?:```)?
and replace with:
\t\1
Second find / replace process would be for adding HTML comment so search for:
(?m)^```\h*(\S+)
and replace it with:
<!-- language: lang-\1 -->\n