diff --git a/app/public/app.js b/app/public/app.js index 725754f..b05da7f 100644 --- a/app/public/app.js +++ b/app/public/app.js @@ -84,8 +84,10 @@ globalThis.init_editor = () => { highlightFormatting: false, fencedCodeBlockHighlighting: false, xml: false, - smartIndent: true, + smartIndent: false, indentUnit: 4, + tabSize: 4, + indentWithTabs: false, placeholder: "", extraKeys: { Home: "goLineLeft", @@ -93,6 +95,7 @@ globalThis.init_editor = () => { Enter: (cm) => { cm.replaceSelection("\n"); }, + Tab: "insertSoftTab", }, }); diff --git a/app/public/style.css b/app/public/style.css index c058fa0..4941128 100644 --- a/app/public/style.css +++ b/app/public/style.css @@ -158,6 +158,7 @@ video { /* button */ .button { + --h: 35.2px; display: flex; justify-content: center; align-items: center; @@ -169,7 +170,9 @@ video { outline: none; border: none; width: max-content; - height: max-content; + height: var(--h); + min-height: var(--h); + max-height: var(--h); transition: background 0.15s; text-decoration: none !important; user-select: none; @@ -190,6 +193,7 @@ video { /* input */ input { + --h: 35.2px; padding: var(--pad-2) var(--pad-4); background: var(--color-raised); color: var(--color-text); @@ -197,6 +201,9 @@ input { border: none; width: max-content; transition: background 0.15s; + height: var(--h); + min-height: var(--h); + max-height: var(--h); } input:focus { @@ -373,8 +380,9 @@ img { blockquote { padding-left: 1rem; - border-left: solid 5px var(--color-super-lowered); - font-style: italic; + border-left: solid 5px var(--color-green); + color: var(--color-green); + opacity: 75%; } /* codemirror/hljs */ diff --git a/src/main.rs b/src/main.rs index a664253..7aabae8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ #![doc = include_str!("../README.md")] +mod markdown; mod model; mod routes; @@ -19,12 +20,10 @@ pub(crate) type InnerState = (DataClient, Tera, String); pub(crate) type State = Arc>; fn render_markdown(value: &Value, _: &HashMap) -> tera::Result { - Ok( - tetratto_shared::markdown::render_markdown(value.as_str().unwrap(), false) - .replace("\\@", "@") - .replace("%5C@", "@") - .into(), - ) + Ok(markdown::render_markdown(value.as_str().unwrap()) + .replace("\\@", "@") + .replace("%5C@", "@") + .into()) } fn remove_script_tags(value: &Value, _: &HashMap) -> tera::Result { diff --git a/src/markdown.rs b/src/markdown.rs new file mode 100644 index 0000000..6f0cfc1 --- /dev/null +++ b/src/markdown.rs @@ -0,0 +1,3 @@ +pub fn render_markdown(input: &str) -> String { + tetratto_shared::markdown::render_markdown(input, false) +} diff --git a/src/routes.rs b/src/routes.rs index bd0130a..81b2d0c 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -175,7 +175,7 @@ struct RenderMarkdown { } async fn render_request(Json(req): Json) -> impl IntoResponse { - tetratto_shared::markdown::render_markdown(&req.content, false) + crate::markdown::render_markdown(&req.content) } #[derive(Deserialize)]