diff --git a/TODO.md b/TODO.md
index fa56e1b..568cd28 100644
--- a/TODO.md
+++ b/TODO.md
@@ -2,3 +2,4 @@
* [X] ~~Сделать кнопку скопировать путь~~
* [X] ~~Сделать кнопку скопировать путь вместе с командой (`note edit ...`)~~
+* [X] ~~Сделать отображение типа кода и кнопку скопировать код~~
diff --git a/src/main.rs b/src/main.rs
index a411824..afa45ef 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -185,9 +185,7 @@ async fn root_handler(State(state): State
"#,
+ );
+
+ let mut output = String::new();
+
match block_kind {
- CodeBlockKind::Indented => "".to_string(),
+ CodeBlockKind::Indented => {
+ output.push_str(&header.replace("%CODE%", "code"));
+ output.push_str("");
+ }
+
CodeBlockKind::Fenced(CowStr::Borrowed("mermaid")) => {
- "".to_string()
+ output.push_str(&header.replace("%CODE%", "mermaid"));
+ output.push_str("");
}
+
CodeBlockKind::Fenced(CowStr::Borrowed("rawmermaid")) => {
- "".to_string()
+ output.push_str(&header.replace("%CODE%", "mermaid"));
+ output.push_str("");
}
- CodeBlockKind::Fenced(code_type) => format!("", code_type),
- }
+
+ CodeBlockKind::Fenced(code_type) => {
+ output.push_str(&header.replace("%CODE%", &code_type));
+ output.push_str(format!("", code_type).as_str());
+ }
+ };
+
+ output
}
fn render_blockquote(quote_kind: Option) -> String {
diff --git a/templates/base.html b/templates/base.html
index 159ad38..cead784 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -55,6 +55,7 @@
overflow: hidden;
background-color: #2b303b;
}
+
.code-header {
display: flex;
justify-content: space-between;