DEV: Correctly tag heredocs (#16061)

This allows text editors to use correct syntax coloring for the heredoc sections.

Heredoc tag names we use:

languages: SQL, JS, RUBY, LUA, HTML, CSS, SCSS, SH, HBS, XML, YAML/YML, MF, ICS
other: MD, TEXT/TXT, RAW, EMAIL
This commit is contained in:
Jarek Radosz
2022-02-28 20:50:55 +01:00
committed by GitHub
parent 7c4be7f649
commit 2fc70c5572
59 changed files with 392 additions and 392 deletions

View File

@ -28,13 +28,13 @@ describe PrettyText do
end
it 'can replace spoilers in emails' do
md = PrettyText.cook(<<~EOF)
md = PrettyText.cook(<<~MD)
hello
[details="Summary"]
world
[/details]
EOF
MD
md = PrettyText.format_for_email(md, post)
html = "<p>hello</p>\n\nSummary <a href=\"#{post.full_url}\">(click for more details)</a>"
@ -42,7 +42,7 @@ describe PrettyText do
end
it 'properly handles multiple spoiler blocks in a post' do
md = PrettyText.cook(<<~EOF)
md = PrettyText.cook(<<~MD)
[details="First"]
body secret stuff very long
[/details]
@ -55,7 +55,7 @@ describe PrettyText do
[details="Third"]
body secret stuff very long
[/details]
EOF
MD
md = PrettyText.format_for_email(md, post)
expect(md).not_to include('secret stuff')
@ -65,12 +65,12 @@ describe PrettyText do
end
it 'escapes summary text' do
md = PrettyText.cook(<<~EOF)
md = PrettyText.cook(<<~MD)
<script>alert('hello')</script>
[details="<script>alert('hello')</script>"]
<script>alert('hello')</script>
[/details]
EOF
MD
md = PrettyText.format_for_email(md, post)
expect(md).not_to include('<script>')