Skip to content

Commit 93a18b7

Browse files
authored
fix(read_rtf): 处理转义字符时错误删除了紧跟其后的空白字符 (#95)
1 parent 29a025e commit 93a18b7

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

src/gb18030/read_rtf.sas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ options cmplib = sasuser.func;
363363
set _tmp_rtf_raw;
364364
reg_rtf_del_ctrl_id = prxparse("s/(?:&reg_ctrl)\s*//o");
365365
reg_rtf_del_ctrl_id_4 = prxparse("s/(?:&reg_ctrl_4)\s*/$1/o");
366-
reg_rtf_del_ctrl_id_5 = prxparse("s/(?:&reg_ctrl_5)\s*/$1/o");
366+
reg_rtf_del_ctrl_id_5 = prxparse("s/(?:&reg_ctrl_5)/$1/o");
367367
if flag_header = "Y" or flag_data = "Y" then do;
368368
context_raw = prxchange(reg_rtf_del_ctrl_id, -1, strip(context_raw));
369369
context_raw = prxchange(reg_rtf_del_ctrl_id_4, -1, strip(context_raw));

src/gbk/read_rtf.sas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ options cmplib = sasuser.func;
363363
set _tmp_rtf_raw;
364364
reg_rtf_del_ctrl_id = prxparse("s/(?:&reg_ctrl)\s*//o");
365365
reg_rtf_del_ctrl_id_4 = prxparse("s/(?:&reg_ctrl_4)\s*/$1/o");
366-
reg_rtf_del_ctrl_id_5 = prxparse("s/(?:&reg_ctrl_5)\s*/$1/o");
366+
reg_rtf_del_ctrl_id_5 = prxparse("s/(?:&reg_ctrl_5)/$1/o");
367367
if flag_header = "Y" or flag_data = "Y" then do;
368368
context_raw = prxchange(reg_rtf_del_ctrl_id, -1, strip(context_raw));
369369
context_raw = prxchange(reg_rtf_del_ctrl_id_4, -1, strip(context_raw));

src/utf16/read_rtf.sas

-6 Bytes
Binary file not shown.

src/utf8/read_rtf.sas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ options cmplib = sasuser.func;
363363
set _tmp_rtf_raw;
364364
reg_rtf_del_ctrl_id = prxparse("s/(?:&reg_ctrl)\s*//o");
365365
reg_rtf_del_ctrl_id_4 = prxparse("s/(?:&reg_ctrl_4)\s*/$1/o");
366-
reg_rtf_del_ctrl_id_5 = prxparse("s/(?:&reg_ctrl_5)\s*/$1/o");
366+
reg_rtf_del_ctrl_id_5 = prxparse("s/(?:&reg_ctrl_5)/$1/o");
367367
if flag_header = "Y" or flag_data = "Y" then do;
368368
context_raw = prxchange(reg_rtf_del_ctrl_id, -1, strip(context_raw));
369369
context_raw = prxchange(reg_rtf_del_ctrl_id_4, -1, strip(context_raw));

0 commit comments

Comments
 (0)