Skip to content

Commit

Permalink
Correct localization of edition
Browse files Browse the repository at this point in the history
  • Loading branch information
TomBener committed Jun 20, 2024
1 parent c0f3aea commit 6c189a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion _extensions/localize-cnbib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function process_bibliography(elem)
local ed_num = extract_digits(ed_text)
local prev_prev_str = elem.content[i - 4]
if ed_num and prev_prev_str and prev_prev_str.t == "Str" and contains_chinese(prev_prev_str.text) then
elem.content[i - 2] = pandoc.Str("" .. ed_num .. "版.")
elem.content[i - 2] = pandoc.Str(ed_num .. "版.")
table.remove(elem.content, i)
table.remove(elem.content, i - 1)
end
Expand Down
6 changes: 3 additions & 3 deletions contents/2-localize-cnbib.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ Pandoc 使用 CSL(Citation Style Language)来格式化参考文献信息,
在中文文献中,`eds.``ed.` 应该替换为 ``
[@lihongzhang2007; @liangqichao2018; @yishabai2018;
@feixiaotong1989; @zuozongtang1986]
不管 `ed.` 既可以表示 ``,也可以表示 `第 X `,相对比较复杂,
不过 `ed.` 既可以表示 ``,也可以表示 ``,相对比较复杂,
请参考下面的例子。

## "ed." 替换为「编」或「第X版
## "ed." 替换为「编」或「

`ed.` 既可以表示 ``
[@feixiaotong1989; @zuozongtang1986]
也可以表示 `第 X `
也可以表示 ``
[@qinhui2019; @taoxisheng2016]
虽然非常灵活,但也给替换带来了一定的困难,
不过好在判断条件比较明确。
Expand Down

0 comments on commit 6c189a6

Please sign in to comment.