File tree Expand file tree Collapse file tree 2 files changed +11
-30
lines changed
Expand file tree Collapse file tree 2 files changed +11
-30
lines changed Original file line number Diff line number Diff line change 11.emphasis-point {
22 font-style : normal ;
3- }
4- .dot {
5- position : relative ;
6- display : inline-block ;
7- }
8- .dot ::after {
9- content : ' ‧' ; /* U+2027 */
10- position : absolute ;
11- bottom : 0 ;
12- left : 50% ;
13- transform : translateX (-50% );
14- font-size : 0.5em ;
15- line-height : 1 ;
16- pointer-events : none ;
3+
4+ -webkit-text-emphasis : ' ‧' ;
5+ -moz-text-emphasis : ' ‧' ;
6+ text-emphasis : ' ‧' ; /* U+2027 */
7+
8+ -webkit-text-emphasis-position : under ;
9+ -moz-text-emphasis-position : under ;
10+ text-emphasis-position : under ;
1711}
Original file line number Diff line number Diff line change 44
55<!-- New Syntax: Emphasis Point `..中文..` -->
66{{- if $.Site.Params.enableEmphasisPoint -}}
7- {{- $emphasisPoints := findRE `\.\.([\p{Han}]+)\.\.` $Content -}}
8- {{- with $emphasisPoints -}}
9- {{- range $emphasisPoints -}}
10- {{- $original := . -}}
11- {{- $text := replaceRE `\.\.(.+)\.\.` `$1` $original -}}
12-
13- {{- $chars := split $text "" -}}
14- {{- $wrapped := "" -}}
15- {{- range $chars -}}
16- {{- $wrapped = printf "%s< span class =\ "dot\"> %s</ span > " $wrapped . -}}
17- {{- end -}}
18-
19- {{- $replacement := printf `< em class ="emphasis-point "> %s</ em > ` $wrapped -}}
20- {{- $Content = replace $Content $original $replacement -}}
21- {{- end -}}
22- {{- end -}}
7+ {{- $regexPatternEmphasisPoint := `\.\.([\p{Han}]+)\.\.` -}}
8+ {{- $regexReplacementEmphasisPoint := `< em class ="emphasis-point "> $1</ em > ` -}}
9+ {{- $Content = $Content | replaceRE $regexPatternEmphasisPoint $regexReplacementEmphasisPoint -}}
2310{{- end -}}
2411
2512<!-- Markdownify -->
You can’t perform that action at this time.
0 commit comments