mirror of
https://github.com/Nutomic/ibis.git
synced 2024-11-22 01:51:10 +00:00
Disable markdown plugins for url shortening and smartquotes (fixes #53)
This commit is contained in:
parent
572a0cb51c
commit
3050617005
3 changed files with 38 additions and 29 deletions
|
@ -99,7 +99,7 @@ fn create_cookie(jwt: String, data: &Data<IbisData>) -> Cookie<'static> {
|
|||
// Must not set cookie domain on localhost
|
||||
// https://stackoverflow.com/a/1188145
|
||||
let domain = data.domain().to_string();
|
||||
if domain.starts_with("localhost") || domain.starts_with("127.0.0.1") {
|
||||
if !domain.starts_with("localhost") && !domain.starts_with("127.0.0.1") {
|
||||
cookie = cookie.domain(domain);
|
||||
}
|
||||
cookie
|
||||
|
|
|
@ -9,7 +9,10 @@ use markdown_it::{
|
|||
pub fn markdown_parser() -> MarkdownIt {
|
||||
let mut parser = MarkdownIt::new();
|
||||
markdown_it::plugins::cmark::add(&mut parser);
|
||||
markdown_it::plugins::extra::add(&mut parser);
|
||||
markdown_it::plugins::extra::linkify::add(&mut parser);
|
||||
markdown_it::plugins::extra::strikethrough::add(&mut parser);
|
||||
markdown_it::plugins::extra::tables::add(&mut parser);
|
||||
markdown_it::plugins::extra::typographer::add(&mut parser);
|
||||
parser.inline.add_rule::<ArticleLinkScanner>();
|
||||
parser
|
||||
}
|
||||
|
|
|
@ -131,10 +131,16 @@ pub fn EditArticle() -> impl IntoView {
|
|||
})
|
||||
}}
|
||||
|
||||
<textarea id="edit-article-textarea" rows=rows on:keyup=move |ev| {
|
||||
let val = event_target_value(&ev);
|
||||
set_text.update(|p| *p = val);
|
||||
}>{article.article.text.clone()}</textarea>
|
||||
<textarea
|
||||
id="edit-article-textarea"
|
||||
rows=rows
|
||||
on:keyup=move |ev| {
|
||||
let val = event_target_value(&ev);
|
||||
set_text.update(|p| *p = val);
|
||||
}
|
||||
>
|
||||
{article.article.text.clone()}
|
||||
</textarea>
|
||||
<div>
|
||||
<a href="https://commonmark.org/help/" target="blank_">
|
||||
Markdown
|
||||
|
@ -142,31 +148,31 @@ pub fn EditArticle() -> impl IntoView {
|
|||
" formatting is supported"
|
||||
</div>
|
||||
<div class="inputs">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Edit summary"
|
||||
value=summary.get_untracked()
|
||||
on:keyup=move |ev| {
|
||||
let val = event_target_value(&ev);
|
||||
set_summary.update(|p| *p = val);
|
||||
}
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Edit summary"
|
||||
value=summary.get_untracked()
|
||||
on:keyup=move |ev| {
|
||||
let val = event_target_value(&ev);
|
||||
set_summary.update(|p| *p = val);
|
||||
}
|
||||
/>
|
||||
|
||||
<button
|
||||
prop:disabled=move || button_is_disabled.get()
|
||||
on:click=move |_| {
|
||||
submit_action
|
||||
.dispatch((
|
||||
text.get(),
|
||||
summary.get(),
|
||||
article_.clone(),
|
||||
edit_response.get(),
|
||||
))
|
||||
}
|
||||
>
|
||||
<button
|
||||
prop:disabled=move || button_is_disabled.get()
|
||||
on:click=move |_| {
|
||||
submit_action
|
||||
.dispatch((
|
||||
text.get(),
|
||||
summary.get(),
|
||||
article_.clone(),
|
||||
edit_response.get(),
|
||||
))
|
||||
}
|
||||
>
|
||||
|
||||
Submit
|
||||
</button>
|
||||
Submit
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue