hwp_script_to_latex 1.3.3 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59cc6876194073f010e08445880f85e7c8e6024d97230a16c641bec57f7414d8
4
- data.tar.gz: 9a376c1b7f2f05e1c0c0b7a486d1e2d43b787c6814fef6f2b23d1d76ae1ee1d9
3
+ metadata.gz: 522017c4a1e98470ae701964b297ac90b3907e2ad6a2fc3210a9af6c20453cd9
4
+ data.tar.gz: 657dce68cf0043a13db0e999f1a10556cd8b0bce9899fbf3624f7b5b6d211845
5
5
  SHA512:
6
- metadata.gz: 060cbeb2370ccd62408c3b7dd2f933216cbe0eea939635941508e2f37a1909310629f7f30f32eca87ddd9e0dd658a24ef51bef1f7f8b8c78b817e8faf359aa37
7
- data.tar.gz: 0c9f3435003b40f4993d0aa1fd4016cabc0da5a08044bd8e3862be872caee47b46eb3bad16e5c59c11c5cda3c71589444e788cfcca7442a1a0c292a6fe835e25
6
+ metadata.gz: 3aa22b50be009b53bbc0369725348d7a754e1574cd36c2ecfacee62898dce63634fc7211e565d414687ef691dfdfe0582fe77354fc71b3b1de8ed21c93e43edc
7
+ data.tar.gz: e0d050f995d6c92f99bba993bc6d0d384255460dafed58f5153233f618f49fa5a93e30bcb0e35333984565f2ea63fa25dc68367c2c884c7091e8b0af50e6d17a
@@ -24,6 +24,7 @@ module HwpScriptToLatex
24
24
  def convert(script, math_mode: false, display_mode: false)
25
25
  # Sanitize for starting convert
26
26
  result = pre_sanitize(script)
27
+ puts result
27
28
  # 키워드 치환
28
29
  result = replace_keywords(result)
29
30
  # Simple Command 치환
@@ -67,6 +68,9 @@ module HwpScriptToLatex
67
68
  script = script.gsub(/\s+/, " ").strip
68
69
  # 백슬래시를 rm으로 치환
69
70
  script = script.gsub(/\\/, " \\rm ")
71
+ # 꺽쇠 치환
72
+ script = script.gsub(/&lt;/, "<")
73
+ script = script.gsub(/&gt;/, ">")
70
74
  # 위, 아래 첨자 명령어로 변경
71
75
  script = script.gsub(/_/, " sub ")
72
76
  script = script.gsub(/\^/, " sup ")
@@ -1,3 +1,3 @@
1
1
  module HwpScriptToLatex
2
- VERSION = "1.3.3"
2
+ VERSION = "1.3.4"
3
3
  end
data/rules.json CHANGED
@@ -104,10 +104,20 @@
104
104
  "keyword": {
105
105
  "meta": [
106
106
  {
107
- "regex": "(?<![a-zA-Z])(?i:left|right)\\b\\s*+(?:(?=[^{}\\[\\]\\|\\(\\)])|(?:$))",
107
+ "regex": "(?<![a-zA-Z])(?i:left|right)\\b\\s*+(?:(?=[^{}\\[\\]\\|\\(\\)<>])|(?:$))",
108
108
  "latex": "",
109
109
  "alphabetic": false
110
110
  },
111
+ {
112
+ "regex": "(?<![a-zA-Z])(?i:left)\\s*<",
113
+ "latex": " \\langle ",
114
+ "alphabetic": false
115
+ },
116
+ {
117
+ "regex": "(?<![a-zA-Z])(?i:right)\\s*>",
118
+ "latex": " \\rangle ",
119
+ "alphabetic": false
120
+ },
111
121
  {
112
122
  "regex": "(?<![a-zA-Z])(?i:left)\\s*\\[",
113
123
  "latex": " \\left [ ",
@@ -588,12 +598,12 @@
588
598
  "alphabetic": false
589
599
  },
590
600
  {
591
- "regex": "(?<![\\s>\\-])>(?![\\s=>])",
601
+ "regex": "(?<![>\\-])(?:(?<!\\s)>|>(?!\\s))(?![=>])",
592
602
  "latex": " > ",
593
603
  "alphabetic": false
594
604
  },
595
605
  {
596
- "regex": "(?<![\\s<])<(?![\\s<=])",
606
+ "regex": "(?<![s<])(?:(?<!\\s)<|<(?!\\s))(?![<=])",
597
607
  "latex": " < ",
598
608
  "alphabetic": false
599
609
  },
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hwp_script_to_latex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - bluesh55