Skip to content

Commit

Permalink
updated numbering format mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Volodymyr Baydalka committed Jul 4, 2023
1 parent eb787e6 commit dfc72da
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 32 deletions.
113 changes: 101 additions & 12 deletions dist/docx-preview.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/docx-preview.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/docx-preview.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/docx-preview.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docx-preview",
"version": "0.1.16",
"version": "0.1.17",
"license": "Apache-2.0",
"keywords": [
"word",
Expand Down
61 changes: 45 additions & 16 deletions src/html-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1183,24 +1183,53 @@ section.${c}>article { margin-bottom: auto; }

numFormatToCssValue(format: string) {
var mapping = {
"none": "none",
"bullet": "disc",
"decimal": "decimal",
"lowerLetter": "lower-alpha",
"upperLetter": "upper-alpha",
"lowerRoman": "lower-roman",
"upperRoman": "upper-roman",
"chineseCounting": "simp-chinese-informal",
"chineseCountingThousand": "simp-chinese-informal",
"chineseLegalSimplified": "simp-chinese-formal", // 中文大写
"ideographTraditional": "cjk-heavenly-stem", // 十天干
"ideographZodiac": "cjk-earthly-branch", // 十二地支
// "ordinal": "", // 1st, 2nd, 3rd,...
// "cardinalText": "", // One, Two, Three,...
"decimalZero": "decimal-leading-zero", // 01,02,03,...
none: "none",
bullet: "disc",
decimal: "decimal",
lowerLetter: "lower-alpha",
upperLetter: "upper-alpha",
lowerRoman: "lower-roman",
upperRoman: "upper-roman",
decimalZero: "decimal-leading-zero", // 01,02,03,...
// ordinal: "", // 1st, 2nd, 3rd,...
// ordinalText: "", //First, Second, Third, ...
// cardinalText: "", //One,Two Three,...
// numberInDash: "", //-1-,-2-,-3-, ...
// hex: "upper-hexadecimal",
aiueo: "katakana",
aiueoFullWidth: "katakana",
chineseCounting: "simp-chinese-informal",
chineseCountingThousand: "simp-chinese-informal",
chineseLegalSimplified: "simp-chinese-formal", // 中文大写
chosung: "hangul-consonant",
ideographDigital: "cjk-ideographic",
ideographTraditional: "cjk-heavenly-stem", // 十天干
ideographLegalTraditional: "trad-chinese-formal",
ideographZodiac: "cjk-earthly-branch", // 十二地支
iroha: "katakana-iroha",
irohaFullWidth: "katakana-iroha",
japaneseCounting: "japanese-informal",
japaneseDigitalTenThousand: "cjk-decimal",
japaneseLegal: "japanese-formal",
thaiNumbers: "thai",
koreanCounting: "korean-hangul-formal",
koreanDigital: "korean-hangul-formal",
koreanDigital2: "korean-hanja-informal",
hebrew1: "hebrew",
hebrew2: "hebrew",
hindiNumbers: "devanagari",
ganada: "hangul",
taiwaneseCounting: "cjk-ideographic",
taiwaneseCountingThousand: "cjk-ideographic",
taiwaneseDigital: "cjk-decimal",
};

return mapping[format] || format;
if (mapping[format])
return mapping[format];

console.log(format);

return format;
}

refreshTabStops() {
Expand Down

0 comments on commit dfc72da

Please sign in to comment.