mirror of https://github.com/tiangolo/fastapi.git
Add `hash-style-comments` and `slash-style-comments` code block languages
This commit is contained in:
parent
9aa406d624
commit
7ff3dfb4fc
|
|
@ -592,6 +592,7 @@ def replace_multiline_code_block(
|
|||
"toml",
|
||||
"yaml",
|
||||
"yml",
|
||||
"hash-style-comments",
|
||||
}:
|
||||
_line_a_code, line_a_comment = _split_hash_comment(line_a)
|
||||
line_b_code, line_b_comment = _split_hash_comment(line_b)
|
||||
|
|
@ -599,7 +600,7 @@ def replace_multiline_code_block(
|
|||
if line_b_comment:
|
||||
res_line = res_line.replace(line_b_comment, line_a_comment, 1)
|
||||
code_block.append(res_line)
|
||||
elif block_language in {"console", "json"}:
|
||||
elif block_language in {"console", "json", "slash-style-comments"}:
|
||||
_line_a_code, line_a_comment = _split_slashes_comment(line_a)
|
||||
line_b_code, line_b_comment = _split_slashes_comment(line_b)
|
||||
res_line = line_b
|
||||
|
|
|
|||
Loading…
Reference in New Issue