掌上百科 - PDAWIKI

 找回密码
 免费注册

QQ登录

只需一步,快速开始

查看: 684|回复: 7

[求助] 请问有什么办法可以去除词典文件中多余的html闭合标签?

[复制链接]
  • TA的每日心情
    慵懒
    2023-3-27 00:18
  • 签到天数: 606 天

    [LV.9]以坛为家II

    发表于 2020-7-4 18:07:05 | 显示全部楼层 |阅读模式
    比如这种:
    1. <div>123</div></div>
    复制代码
    0 c# i  M( ^) Z0 p/ A
    当然这个只是最简单的例子,实际应用当中会有更复杂的嵌套关系,我尝试用正则,感觉无解。& p: @: B: H0 d
    我知道html tidy可以去除多余标签,可是它同时会格式化代码并且添加常规html所需的一些标签,而那些标签对于mdx来说是多余的。所以想问问有没有办法只去除多余标签不做其他的改动。
  • TA的每日心情
    奋斗
    2019-10-13 07:34
  • 签到天数: 209 天

    [LV.7]常住居民III

    发表于 2020-7-4 18:52:16 | 显示全部楼层
    ### Tidy 格式化 mdx 源文件技巧# N" K4 ~  i. K' v
    9 l+ w- S, x" j, p6 D
    若采用默认 tidy 配置,mdx 源文件 tidy 后会出现如下问题:
    5 T& A# g' v7 k: Q6 @! ~2 P: U; ?5 b6 Z
    - Q1:添加了`<html><head></head></html>`等不必要的内容,造成 mdx 语法及词条内容错误
    ! E/ f2 _0 x1 L* x) p- Q2:无法识别 mdx 标签</>,并将其转化为可读性差的 HTML entities `&lt;/&gt;`
    ( G- V! y" {) n/ {0 d# I5 x) `+ i! p* D- Q3:将 keyword 与上下行合并,造成 mdx 语法及词条内容错误
    3 V3 o6 \: O6 b+ j6 |
    1 ^* e: o' {3 @8 [: X% X  s解决方案:1 U4 ^/ M* b% @) p- @

    : ~6 s0 G9 J+ u, nQ1:配置 tidy configy.txt 文件:8 K  g+ K- R1 l/ K/ ^/ ~

    ( d( ?$ V4 v8 v7 l6 H0 B    show-body-only: yes
    ( n2 ]: x8 |! }9 y7 y
    ' z/ |* H9 ]8 L9 H( PQ2 和 Q3:( C2 Z5 D9 M+ N8 F& ]: n
    , Y5 z4 j+ s9 y3 d
    1. 需暂时变换</>和关键字,以便 Tidy 正确识别# ~; ]+ d' g1 q( V# J

    # m7 \, q: s1 N* A    "将</>替换为<mdx/>\r<keyword>
    1 d: n( W: A6 A0 G) L4 p    :%s/<\/>\n/<mdx\/>\r<keyword>/
    + _1 d2 @* I2 D1 I* Q+ F/ X    "在关键字的最后添加</keyword>4 c; \( F9 j  r2 X7 B
        :%s/\v(\<keyword\>)(.*)/\1\2\<\/keyword\>/4 g. \, p5 R2 v9 _
    1 ?9 i0 n! I' T
    2. 配置 Tidy 的 configy.txt 文件:
    5 X& u- `" p2 `/ v( ]
    ' @, g' X2 l1 l    new-empty-tags: mdx
    ) u0 _* }/ U% Y$ K$ B  G/ e/ R    new-blocklevel-tags: keyword
    " h4 S7 l; `6 @1 S
    1 r* R6 C2 j! o, J; b: N3 p0 A3. 执行 Tidy,最后将输出的文件恢复为 mdx 语法格式  T9 e- }( z+ S
    6 L  e' T" n# A! v6 I  m% r
        " 将<mdx />恢复为</>
    , k+ Q* ?) Z6 |5 n& m( K    :%s/<mdx \/>/<\/>/# O. z9 G# _; b
        " 将<keyword>和</keyword>删除7 r1 ?2 e4 ^1 U
        :%s/<\%[/]keyword>//g
    , R8 R& X2 b# r! X; l: t
  • TA的每日心情
    奋斗
    2019-10-13 07:34
  • 签到天数: 209 天

    [LV.7]常住居民III

    发表于 2020-7-4 18:54:30 | 显示全部楼层
    //HTML Tidy 5.6.0 Options for mdx  d5 ?4 Y8 V) G: [; f! M

    * m9 M* n! c$ s2 y6 g9 ^1 A//请特别关注以下选项
    . q; ?& `- n6 \" T5 l- q% x. q//show-body-only, output-xhtml
    9 j; V+ q" j5 z2 ~  d  F//quiet, indent, tidy-mark, wrap& k/ [) P6 X+ n
    //break-before-br, i0 [% D4 ^* D! a% d4 p6 r
    //logical-emphasis
    % C5 j) y/ D8 i& G//hide-comments
    ) R7 o" X- d3 p+ h6 [+ C//new-blocklevel-tags5 \3 p2 c+ {1 g$ I
    //new-empty-tags
    " Y4 j( _9 G  w8 g) w
    3 w' D( G5 J! |1 ?& U/ o  L2 \//Document Display Options
    ; U7 X7 I) e8 c! d5 u2 ugnu-emacs: no9 t! N3 P. ^$ o: t2 |
    markup: yes3 m/ g9 Q: R1 m0 j( R
    mute:' I4 _- M6 m' \5 K' O4 g
    mute-id: no6 j& T& s# {5 k' T. T/ e% z( k" p( m
    quiet: yes" }% [& q, m" F: n( {- N( P& |( ^
    show-body-only: yes
    : N: R5 q4 l: A' Cshow-errors: 6
    & }) v: [' m' l# \" Kshow-info: yes: ?/ {' ?. S! S3 _! \9 O# L
    show-warnings: yes1 r4 X/ x4 v8 T# ^* P/ N+ C8 S
    # Z6 e0 M/ W3 }
    //Document In and Out Options
    + u( G( A8 B9 u- Tadd-meta-charset: no7 S8 e7 X- T0 V+ m3 Q( s
    add-xml-decl: no
    ' ]! s2 B* w3 o: c0 L  fadd-xml-space: no
    * f) {8 x# F8 K2 l; G% vdoctype: auto1 f# ]7 G% c: `2 P
    input-xml: no
      n0 v7 U0 q$ L9 x$ qoutput-html: no" ^' P2 L/ R! F% x" K. @8 C
    output-xhtml: yes" \3 S; j+ N1 E7 x4 [: O% g) t2 T! A
    output-xml: no/ ]1 Z/ S9 }# e/ n+ {: x

    % v" f$ _  u) Z//File Input-Output Options4 y& L; Y2 x( ?8 t8 N# j- T. f! O
    error-file:
    2 m* T# O* ]: e* [keep-time: no' W. _: ]; D  }) ?* N1 \
    output-file:
    # M1 \- Q) J4 q8 x) ?; r# a& owrite-back: no
    $ m# h2 K! m, ]7 W4 R( s/ O& {* |8 x4 b2 o7 x* |
    //Diagnostics Options Reference
    ' a) F  b1 ~  daccessibility-check: 0- f: Q* d. W; i% \- S
    force-output: no
    5 K6 Z2 v' Y: T, f7 kshow-meta-change: no
    1 w# e* W9 v; v/ ywarn-proprietary-attributes: yes
    2 M0 h' g7 C, o
    8 k" B* E& m( Z* s/ N//Encoding Options Reference
    ( `8 H. t) T" Q4 achar-encoding: utf8
    ! F) s4 m$ I! q# |3 O0 minput-encoding: utf8
    1 z# s+ q! z1 v5 c+ Onewline: CRLF/ F, ]1 |! v5 Z1 ~3 ~
    output-bom: auto/ j8 a" c6 J' I4 @
    output-encoding: utf8( v" q3 F8 Y9 z5 [; z, T

    ; Q) @; @6 F1 K: p: I1 |" A. q3 c( z& y//Cleanup Options Reference$ r. b3 U5 V5 m8 y6 }& r
    bare: no, k, k$ a9 [3 m0 y
    clean: yes) K5 [' H( O0 y" u2 D
    drop-empty-elements: yes
    0 _5 ]6 K( M) f( Hdrop-empty-paras: yes+ }2 T. d/ X  _  R! _2 ]
    drop-proprietary-attributes: no
    2 G  s( \& u0 n; m" M" ^5 Ygdoc: no
    " m( n9 D) H: E8 W1 @, Wlogical-emphasis: yes1 j0 k# ?3 W* G9 q
    merge-divs: auto
    9 A& `% v* g/ l- rmerge-spans: auto8 Q3 D9 W. k5 T3 I
    word-2000: no+ J" t& v; H8 K! @

    8 H- [5 b0 u7 e7 ]2 O: \//Entities Options Reference
    ( ]2 f0 m, H3 k8 {2 t  {1 cascii-chars: no
    ) _6 g) S: m. i- [; R1 T/ pncr: yes
    2 g9 L& C; d4 V& ]/ y0 D- Z7 i8 ]numeric-entities: no+ I" y" P; k, |3 d0 ?
    preserve-entities: no
    + M" c+ h& i8 d2 S  i- C  \  c" Qquote-ampersand: no
    * p2 W) ?- k( j% ^0 s& B  Dquote-marks: no
    5 z. ]4 \3 }. equote-nbsp: yes
    ! Q% i: D. y. h& |$ |2 W0 s( j4 N5 `3 e" b1 P% w6 t
    //Repair Options Reference
    7 V$ g7 K2 h' d/ y3 Nalt-text:7 |& J& i. C5 K" T. n
    anchor-as-name: yes
    . g/ r! l; }6 B3 kassume-xml-procins: no
    2 L# {/ A* x5 M) `8 S, C+ a1 @coerce-endtags: yes
    4 a) m; B* p$ t! q# J* r! C3 Fcss-prefix: c
    ! D* p/ {$ s+ c8 D3 k; Ycustom-tags: no/ {' h: u( E7 ?6 G
    enclose-block-text: no
    2 p0 |4 V; g. h1 P& [4 I! jenclose-text: no5 U8 z8 [2 p% S4 J* i/ I7 N! M
    escape-scripts: no
    : F2 }. e" l  B, H; g" t+ S& rfix-backslash: yes
    , C, D# c" O: F4 Sfix-bad-comments: auto" [3 W5 w7 h% U
    fix-style-tags: yes2 B5 n! B& c! c3 f3 Q" g/ F* ?
    fix-uri: yes* P8 z4 o6 s' O7 |6 U* v  H% t
    literal-attributes: no
    * O& G0 I! K! K; W2 a: n0 vlower-literals: yes
    % \; _/ @( q- Y1 ^' E* {6 L" `repeated-attributes: keep-last1 R) W" Z, `& z2 A6 ^  n
    skip-nested: yes
      m. \; n# K9 ^$ W; wstrict-tags-attributes: no0 S4 D% Z% M) C4 G/ K2 o$ l" D
    uppercase-attributes: no% Y7 y1 j5 n- j, X2 n; X: S
    uppercase-tags: no; m. P  Y4 `( E* I; N- a" a

    . z8 S, R, P( x0 C% G//Transformation Options Reference
      a$ ^$ o1 p, A7 T5 }% W4 Y3 Idecorate-inferred-ul: no, ?) Y- ^" L1 _: o; h8 l; r
    escape-cdata: no
    , w! ?; N$ {8 B1 [. Fhide-comments: no) G5 R! B: C+ k/ p8 l2 A% t" v9 \
    join-classes: no
    ( c/ p$ B6 M/ E; \join-styles: yes
    # ~, k% E2 a  @" ^! {, jmerge-emphasis: yes
    6 `8 t9 v4 o% p. X5 H+ }replace-color: no0 ^: ]: e! C- J' z! d9 D) R  Q8 b

    . r* [$ ?- v4 ?# B7 o//Teaching Tidy Options Reference( Z$ _4 \  n1 K
    new-blocklevel-tags: keyword, L# t# N5 ]3 u
    new-empty-tags: mdx
    , z" _: Z$ z8 t- A0 L/ cnew-inline-tags:+ _. ~4 Y7 I; e( r& a. X
    new-pre-tags:
    & r) x: l. K! F7 [
    1 ~. K4 u: l. V" t& b$ X0 a3 I//Pretty Print Options Reference( x' K4 Z# O9 Z, P* I8 U/ W
    break-before-br: yes
    $ m! o& L; x. u( m: d7 G+ t" `1 U; |indent: auto
    , y- Q: t+ M0 Z& _$ tindent-attributes: no4 X* X4 ~  k& R: R9 s( X; ?  s
    indent-cdata: no" L- K( _' l/ _5 g! |# f
    indent-spaces: 4! l1 L! \& E" H/ r" O) ^, N
    indent-with-tabs: no
    2 Z! A& G" p  T, c5 d: S8 W5 _3 Kkeep-tabs: no& U+ [; H0 v5 t7 ?5 p( l
    tab-size: 4
    # ~1 ^& Z+ ~+ M8 b- |: J" yomit-optional-tags: no
    7 T: g/ ^2 q% A7 s4 bpriority-attributes:) B" K( j$ H, r
    sort-attributes: none
    ! ?% c, I$ Z8 ^/ Hpunctuation-wrap: no
    8 {8 l, B, n4 D8 d# rtidy-mark: no
    1 ?* _5 Q2 q. ]; g; w6 C& ^7 X! evertical-space: no1 I! g' G4 c4 d# ]. x' k2 r
    wrap: 03 `# v( h, I( F2 @1 U! N/ \( X
    wrap-asp: yes
    1 w8 ~" ^* W( F. c5 K0 [wrap-attributes: no3 s, p  V. N7 l2 Q) m
    wrap-jste: yes
    % F" t! ]' E: R6 ^9 ]0 iwrap-php: yes
    + x* Y9 W5 c, I( O* m8 ywrap-script-literals: no
    * P4 M- d" y( y9 V: k0 Awrap-sections: yes2 D* j! T2 k9 D3 A
  • TA的每日心情
    无聊
    2021-1-15 05:13
  • 签到天数: 271 天

    [LV.8]以坛为家I

    发表于 2020-7-5 02:00:19 | 显示全部楼层
    本帖最后由 EarthWorm 于 2020-8-5 05:30 编辑 + l1 D* u7 [. `# c0 g& J# I

    ' j/ G- {3 |) ]* L8 BEmEditor 自带一个特殊的功能: 高亮闭合标签内容. 配合简单的宏, 可以在代码量最少的情况下完成你所需的任务
    : ]" @( [% h+ Z4 m6 _/ a9 G8 X+ I) Q- N2 \9 u
    说实话, 这是一种比较笨的办法, 效率低下还有可能程序失去响应, 如果编辑的文件比较大, 程序会处于假死状态, 不要动电脑, 正常情况下会跑完的. 高级点的办法可以用 Python 的 bs4 库来完成, 那个我就没法帮你了, 我只是知道它可以处理, 怎么做你得自己查资料, 我也得现学...
  • TA的每日心情
    慵懒
    2023-3-27 00:18
  • 签到天数: 606 天

    [LV.9]以坛为家II

     楼主| 发表于 2020-7-5 11:08:06 | 显示全部楼层
    本帖最后由 preachers 于 2020-7-5 12:52 编辑
    1 |, ?! D. M9 T% [; i  Z
    VimVim 发表于 2020-7-4 18:54
    , n" s% x# ~2 V5 g* T//HTML Tidy 5.6.0 Options for mdx
    : k/ K; [# _: q! s, W/ l4 j/ T& q4 I( B
      C' s( J. b. k' n" o//请特别关注以下选项

    3 C8 @' [8 G1 C! n我用这个config文件处理词典的文本,它确实去掉了多余的闭合标签,不过它也会去掉一些似乎有用的标签,比如:) {: G2 I7 U9 G- F6 b0 J$ q
    1. <div class='even'><div></div><div colspan='2' class='FrEx'>I'll be back in two or three minutes.</div></div>
    复制代码
      n, x- X! u, X1 i* c2 w
    变成:
    0 t8 n9 p  K$ d4 T1 v. ^. R+ Z: W
    1. <div colspan='2' class='FrEx'>I'll be back in two or three minutes.</div>
    复制代码

    ! _) H0 Z2 D  N9 a# ]4 l; w我不知道在原来的词典文件中这个叫even的class是不是在css里面会有什么特殊用途,不过感觉它这样删标签还是可能会影响最后的结果。
    % J% v# q9 ~; H" i! e2 a另外很重要的一点是,经过tidy处理的html会被格式化,本来没有多少行的代码会被拆分成好多好多行(我测试的文档里面源文件是189行,过了tidy后变成了655行),这样的文件如果在emeditor里面再做处理是很崩溃的。
  • TA的每日心情
    慵懒
    2023-3-27 00:18
  • 签到天数: 606 天

    [LV.9]以坛为家II

     楼主| 发表于 2020-7-5 11:25:07 | 显示全部楼层
    EarthWorm 发表于 2020-7-5 02:00
    ! s/ N3 |) H" Y6 l  x) Y! A' SEmEditor 自带一个特殊的功能: 高亮闭合标签内容. 配合简单的宏, 可以在代码量最少的情况下完成你所需的任 ...
    0 Z0 f9 o% E' l
    谢谢你的建议,我对emeditor的macro不太熟,不过根据你提供的代码我查了查reference,大概明白了你这段的意思,你是根据一个opening tag来找closing tag然后删掉后者,如果我理解没错的话,这个功能并不是我所需要的,因为我要删除的是单独多出来的closing tag,而不是能跟一个opening tag配成一对的。, ?! w  g) ]# c7 s4 b
    ; g9 O1 G7 R1 M& h
    至于python我也不太会,我玩的是powershell + c#的路子,不过你能提供bs4库解决这个问题的基本逻辑吗?如果可以的话我也可以用同样的逻辑寻找c#的对应处理办法。
  • TA的每日心情
    奋斗
    2019-10-13 07:34
  • 签到天数: 209 天

    [LV.7]常住居民III

    发表于 2020-7-5 19:58:32 | 显示全部楼层
    preachers 发表于 2020-7-5 11:08, N: v, S) E3 S5 g. S! M
    我用这个config文件处理词典的文本,它确实去掉了多余的闭合标签,不过它也会去掉一些似乎有用的标签,比 ...

    4 s! J# \  T7 m9 O7 M$ b: y  k0 sjoin-styles: no
    5 X, v# C' s! q1 t+ x$ |+ w5 n, e- a/ K
    tidy的配置很灵活的,你的所有问题都有答案。
  • TA的每日心情
    慵懒
    2023-3-27 00:18
  • 签到天数: 606 天

    [LV.9]以坛为家II

     楼主| 发表于 2020-7-6 13:13:54 | 显示全部楼层
    本帖最后由 preachers 于 2020-7-6 13:18 编辑
    ) J! T: W; h9 a$ h/ K. E0 w
    VimVim 发表于 2020-7-5 19:58
    1 }) T# Q+ @; c6 D7 U& ^join-styles: no; e& p1 d% j, t& [, x5 t
    : s: F& t- s( R/ ^
    tidy的配置很灵活的,你的所有问题都有答案。
    3 X) V& J. B# I2 w
    恩,我把tidy的配置说明基本看了一遍,把配置文件已经改成这样了
    0 u, p0 B! a2 u# u8 K% L( S% X. \
    1. //Document Display Options6 |* A2 j, [+ t# E# G
    2. gnu-emacs: no
      : B6 s3 @; r) e* p# {  ?
    3. markup: yes8 C* t0 J. N* @' v) C; |& T, d
    4. mute:
      3 R4 p2 }: t8 A" ]! e4 G5 T8 ?
    5. mute-id: no( |% A2 p$ I- n8 h- S/ X0 U
    6. quiet: yes. i6 c0 e+ I; a) G; w
    7. show-body-only: yes3 z/ j1 t9 O" ~8 S: B7 u
    8. show-errors: 6
      & Y3 g" }1 }8 z# ^
    9. show-info: yes( D5 t" w  o0 a0 `
    10. show-warnings: yes
      5 G& Z( K6 H' Y% F+ U( A
    11. 6 s! @, ]! v' J! b: e
    12. //Document In and Out Options
      $ G, c1 H7 `0 [
    13. add-meta-charset: no
      ! [, |5 b1 I$ }* u8 H
    14. add-xml-decl: no
      + S0 `* K; o% k
    15. add-xml-space: no8 x+ ?" _& a8 B9 C& Y
    16. doctype: auto% V7 _) o( d, t: c7 G8 N6 X  P  O9 R
    17. input-xml: no& P9 f( o% x0 C# O; f
    18. output-html: no
      + u& q! ]( P7 _$ `: ]- q
    19. output-xhtml: yes
      # f9 f+ d" d& q0 K7 C/ |, `; v
    20. output-xml: no+ Z, C; n; m; d9 ]# z, d
    21. : X% I7 k( R4 |$ ?, R
    22. //File Input-Output Options8 U0 s2 J7 n3 Y5 C+ [; c
    23. error-file:) O  U7 Z1 M0 d. g
    24. keep-time: no
      & {8 e* Z2 p  V; ]
    25. output-file:  i9 m5 F' Y; e! t9 p3 ^0 \  M
    26. write-back: no/ Q; @9 b; G# g! {3 C3 U3 o

    27. + Z! \: {  l5 h0 U  _
    28. //Diagnostics Options Reference
      9 u( h/ D  J  _  X; i
    29. accessibility-check: 0
        e5 f* L; c  I4 r8 {' o
    30. force-output: no8 m' v! u$ q$ S8 F4 c) \* @
    31. show-meta-change: no
      1 f8 X, |5 L# M' }/ |1 l
    32. warn-proprietary-attributes: yes$ R$ B  C  r! Y7 j# t

    33. / I# U! K% i* J9 j2 m8 _
    34. //Encoding Options Reference# F3 F4 }! U) A% j' V% Z& }5 }0 {, R  B
    35. char-encoding: utf8
      1 a7 I% H4 R3 B2 u
    36. input-encoding: utf8
      & x- W4 j# ?- W6 J4 a
    37. newline: CRLF
      1 @5 |& k# v: {) R: e6 J! b
    38. output-bom: auto
      / K! d. A2 g/ k. |! @4 w1 Q9 z1 C8 W6 ^
    39. output-encoding: utf8
      $ v! [" P0 j1 T: Z/ d  D2 d" f( K
    40. * V" Y/ f7 a% q5 B" {, l6 U6 h2 s
    41. //Cleanup Options Reference; d& D, ?( A' }! m0 X$ ^2 G
    42. bare: no+ b6 c1 [7 S9 I4 y) v' J. a! L
    43. clean: no
      , _5 y; i' Z  }) O# A# \- u  |1 s
    44. drop-empty-elements: no; Z# l& L; n0 O; d7 e+ a7 o" x
    45. drop-empty-paras: no0 q; }2 G5 @' e0 ?, x; ~/ p
    46. drop-proprietary-attributes: no8 |: ~0 O) N; B& _5 o
    47. gdoc: no
        ^7 R8 {( b0 m( R* A" `8 k
    48. logical-emphasis: no; q2 w! m( y- [1 d0 P+ \7 ?  x
    49. merge-divs: no
      % @2 ?3 _( \- ?* I8 D- d
    50. merge-spans: no% d- N# X3 ^- ~' b; N9 M6 L# t# ]
    51. word-2000: no
      ) g- T8 x4 F$ S
    52. ( S# e6 `, g' }2 |
    53. //Entities Options Reference. D- F+ d3 c# N1 G8 H5 G
    54. ascii-chars: no- p& \8 x" C9 G" U9 N6 Q
    55. ncr: yes! j& Y% b2 a# M: D# s
    56. numeric-entities: no
      * f+ }" ^8 P& H3 z9 b4 Q$ r
    57. preserve-entities: no& Q& A, L9 e( L
    58. quote-ampersand: no
      1 ?# a: ]4 @, h- O4 `
    59. quote-marks: no$ m( d. Y3 C* M" r
    60. quote-nbsp: yes# H; j8 T8 R+ Q3 s
    61. ! w/ k6 j5 F- F8 q- o
    62. //Repair Options Reference( y9 [0 n  W/ j' E) c5 X+ G
    63. alt-text:
      ( q$ Z3 w' r' Q# c( L
    64. anchor-as-name: no/ Y. T5 B1 Y* F( M/ p1 |& r
    65. assume-xml-procins: no
      ' t- \& \& |+ f  n1 h% K
    66. coerce-endtags: no" E+ L6 r% n- I. |$ n6 z
    67. css-prefix: c+ B" x' d, Q, D" j) }
    68. custom-tags: no
      + S- w7 v9 I2 x" i7 N
    69. enclose-block-text: no% N1 c. C+ L5 Y& D: j5 e
    70. enclose-text: no
      ! g; @) J; L. s* L& H
    71. escape-scripts: no
      & R' Q4 n9 f$ e( @, Y2 R% c  Q
    72. fix-backslash: no
      . P8 j% o6 m5 z/ U* ^4 T) J* x$ |
    73. fix-bad-comments: auto
      & k, ]5 I% \& N6 O  ~
    74. fix-style-tags: no
      8 \6 }; t- n# g
    75. fix-uri: no
      4 a, b6 S3 a2 e6 P+ F
    76. literal-attributes: no) {5 ]& f" F2 V) d; y- }  g% H
    77. lower-literals: no
      3 Q$ n" O( }2 U3 ]  x9 j8 |
    78. repeated-attributes: keep-last+ w# u. z- G7 Y9 n' L
    79. skip-nested: no
      ( {, M+ x2 F- \4 s% Q
    80. strict-tags-attributes: no
      7 v; ?  n: `) m* n8 P2 D  u" c
    81. uppercase-attributes: no
      ) ~; g9 {1 i3 Y! u
    82. uppercase-tags: no
      . s+ u* f4 G& X, u/ q, m
    83. 0 V1 P8 J- Q8 W+ Q+ C) ]7 |
    84. //Transformation Options Reference
      8 K# m4 z  n. a
    85. decorate-inferred-ul: no
      " @8 X* m: D( N1 N) W( q
    86. escape-cdata: no
      + n4 u- Y; `. D) Q5 l
    87. hide-comments: no1 V1 S1 u: j+ r( e4 U
    88. join-classes: no9 ~2 X4 I& P3 U8 O' [, G; _
    89. join-styles: no
      3 O9 H; D" X7 L; G# s5 Q9 _; i+ ^
    90. merge-emphasis: no5 Q" O: I3 _. |$ U6 A- _! Z
    91. replace-color: no
      8 Z5 ?! Q; v1 s; Z0 I

    92. , N5 ~' r& l1 [  n. h
    93. //Teaching Tidy Options Reference
      + k0 c; F' V7 E, H( M3 o
    94. new-blocklevel-tags: keyword
      1 a& @% o+ A! E
    95. new-empty-tags: mdx
      $ Z, J8 z1 R4 _3 Q) M
    96. new-inline-tags:8 q& ~: x9 y2 D8 X7 o0 M
    97. new-pre-tags:
      " Y+ ~. L# ]8 S
    98. ! t+ L6 U0 G0 z5 `& @1 a
    99. //Pretty Print Options Reference: d. ], q) Q  b. L( x! e) D
    100. break-before-br: no7 I/ H& U3 l) R
    101. indent: no
      3 I/ i& ]$ ^3 S  \" ]9 Z
    102. indent-attributes: no
      8 \7 t! Q7 V% Y  k6 C, U' F
    103. indent-cdata: no
      1 }2 w# e1 J, R4 s  E
    104. indent-spaces: 4
      * ~' p6 }8 y* ^  C! n' n' @
    105. indent-with-tabs: no
      3 z/ }* \5 x/ [% I0 s3 u
    106. keep-tabs: no
      5 _  ~$ i6 T5 t6 j; Y
    107. tab-size: 49 \! x9 |! c, S; d
    108. omit-optional-tags: no
      - Z/ r) W- G( i
    109. priority-attributes:
      + i- P; |, Z* M' T3 R
    110. sort-attributes: none
      - z9 ?" [/ O$ {
    111. punctuation-wrap: no
      8 X3 R6 V: v! r3 z1 V' h6 ], b& _
    112. tidy-mark: no
      : `" v6 A3 H1 e: f! k3 s
    113. vertical-space: no
      $ n, p; e; T9 m" Q
    114. wrap: 0
      * }% `0 v9 C3 c
    115. wrap-asp: no
      ! A1 a9 A4 ^' V' ~6 E  g4 b
    116. wrap-attributes: no$ Q4 s% y# W4 _/ H6 P; F8 i
    117. wrap-jste: no. O- h- {! \% z( I! }- W
    118. wrap-php: no8 Y! C; v& X" Z4 d, l$ p, i$ F0 V
    119. wrap-script-literals: no
      & w+ c6 U) `7 W- b  f/ i" l# D! }
    120. wrap-sections: no
    复制代码

    . y, G: ~8 {& L3 ?2 z0 d
    5 {' Z8 L/ Z( F" Y  c! y) R- F  S基本上能变成no的全变成no了。之前去掉的一些标签确实得以保留,但是最崩溃的还是它把行数分成那么多,这个我找遍配置参数也没找到能改变这个的。
    ! p4 D8 o+ H1 g: [0 X) [* l虽然这个换行的问题其实可以在处理之后用正则再替换回来,但是很麻烦,如果我想保留词典源文件本来的换行规则的话几乎是不可能的,我只能选择把每个词条都变成一整行,所以如果tidy本身能设置成保留原来的格式是最好的。
    . U* y" h* J8 [6 c! ?/ O5 J) p; v( F# n) D, e8 S: l% N
    您需要登录后才可以回帖 登录 | 免费注册

    本版积分规则

    小黑屋|手机版|Archiver|PDAWIKI |网站地图

    GMT+8, 2024-4-24 13:29 , Processed in 0.044774 second(s), 8 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2023, Tencent Cloud.

    快速回复 返回顶部 返回列表