add cite tag for block quote attributions
This commit is contained in:
parent
2e0bf0147a
commit
fc7c504e02
|
@ -2,6 +2,8 @@ changelog
|
||||||
|
|
||||||
-- next
|
-- next
|
||||||
|
|
||||||
|
+ Add cite tag for block quote attributions.
|
||||||
|
|
||||||
+ @media print styles.
|
+ @media print styles.
|
||||||
|
|
||||||
+ Disable overscroll (pull down) refresh.
|
+ Disable overscroll (pull down) refresh.
|
||||||
|
|
|
@ -28,7 +28,7 @@ var re_bolder = regexp.MustCompile(`(^|\W)\*\*((?s:.*?))\*\*($|\W)`)
|
||||||
var re_italicer = regexp.MustCompile(`(^|\W)\*((?s:.*?))\*($|\W)`)
|
var re_italicer = regexp.MustCompile(`(^|\W)\*((?s:.*?))\*($|\W)`)
|
||||||
var re_bigcoder = regexp.MustCompile("```(.*)\n?((?s:.*?))\n?```\n?")
|
var re_bigcoder = regexp.MustCompile("```(.*)\n?((?s:.*?))\n?```\n?")
|
||||||
var re_coder = regexp.MustCompile("`([^`]*)`")
|
var re_coder = regexp.MustCompile("`([^`]*)`")
|
||||||
var re_quoter = regexp.MustCompile(`(?m:^> (.*)\n?)`)
|
var re_quoter = regexp.MustCompile(`(?m:^> (.*)(\n-(.*))?\n?)`)
|
||||||
var re_link = regexp.MustCompile(`.?.?https?://[^\s"]+[\w/)!]`)
|
var re_link = regexp.MustCompile(`.?.?https?://[^\s"]+[\w/)!]`)
|
||||||
var re_zerolink = regexp.MustCompile(`\[([^]]*)\]\(([^)]*\)?)\)`)
|
var re_zerolink = regexp.MustCompile(`\[([^]]*)\]\(([^)]*\)?)\)`)
|
||||||
var re_imgfix = regexp.MustCompile(`<img ([^>]*)>`)
|
var re_imgfix = regexp.MustCompile(`<img ([^>]*)>`)
|
||||||
|
@ -77,7 +77,7 @@ func markitzero(s string) string {
|
||||||
s = re_zerolink.ReplaceAllString(s, `<a href="$2">$1</a>`)
|
s = re_zerolink.ReplaceAllString(s, `<a href="$2">$1</a>`)
|
||||||
s = re_bolder.ReplaceAllString(s, "$1<b>$2</b>$3")
|
s = re_bolder.ReplaceAllString(s, "$1<b>$2</b>$3")
|
||||||
s = re_italicer.ReplaceAllString(s, "$1<i>$2</i>$3")
|
s = re_italicer.ReplaceAllString(s, "$1<i>$2</i>$3")
|
||||||
s = re_quoter.ReplaceAllString(s, "<blockquote>$1</blockquote><p>")
|
s = re_quoter.ReplaceAllString(s, "<blockquote>$1<br><cite>$3</cite></blockquote><p>")
|
||||||
s = strings.Replace(s, "\n---\n", "<hr><p>", -1)
|
s = strings.Replace(s, "\n---\n", "<hr><p>", -1)
|
||||||
|
|
||||||
s = re_lister.ReplaceAllStringFunc(s, func(m string) string {
|
s = re_lister.ReplaceAllStringFunc(s, func(m string) string {
|
||||||
|
@ -117,6 +117,7 @@ func markitzero(s string) string {
|
||||||
// some final fixups
|
// some final fixups
|
||||||
s = strings.Replace(s, "\n", "<br>", -1)
|
s = strings.Replace(s, "\n", "<br>", -1)
|
||||||
s = strings.Replace(s, "<br><blockquote>", "<blockquote>", -1)
|
s = strings.Replace(s, "<br><blockquote>", "<blockquote>", -1)
|
||||||
|
s = strings.Replace(s, "<br><cite></cite>", "", -1)
|
||||||
s = strings.Replace(s, "<br><pre>", "<pre>", -1)
|
s = strings.Replace(s, "<br><pre>", "<pre>", -1)
|
||||||
s = strings.Replace(s, "<br><ul>", "<ul>", -1)
|
s = strings.Replace(s, "<br><ul>", "<ul>", -1)
|
||||||
s = strings.Replace(s, "<p><br>", "<p>", -1)
|
s = strings.Replace(s, "<p><br>", "<p>", -1)
|
||||||
|
|
|
@ -23,6 +23,9 @@ blockquote {
|
||||||
padding-left: 0.5em;
|
padding-left: 0.5em;
|
||||||
border-left: 1px solid var(--fg-subtle);
|
border-left: 1px solid var(--fg-subtle);
|
||||||
}
|
}
|
||||||
|
blockquote cite {
|
||||||
|
margin-left: 2em;
|
||||||
|
}
|
||||||
table {
|
table {
|
||||||
display: block;
|
display: block;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|
Loading…
Reference in New Issue