mirror of
https://github.com/fastapi/fastapi.git
synced 2026-02-25 11:19:15 -05:00
Add hash-style-comments and slash-style-comments code block languages
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user