| 193 | }; |
| 194 | |
| 195 | const solveLine = value => { |
| 196 | // 横线和竖线的正则匹配 |
| 197 | const hlineReg = /-[-]+-/; |
| 198 | const vlineReg = /\+[+]+\+/; |
| 199 | const strongHlineReg = /\*\*-[-]+-\*\*/; |
| 200 | const strongVlineReg = /\*\*\+[+]+\+\*\*/; |
| 201 | const colorHlineReg = /`-[-]+-`/; |
| 202 | const colorVlineReg = /`\+[+]+\+`/; |
| 203 | const strongColorHlineReg = /\*\*`-[-]+-`\*\*/; |
| 204 | const strongColorVlineReg = /\*\*`\+[+]+\+`\*\*/; |
| 205 | |
| 206 | let html; |
| 207 | |
| 208 | if (strongColorHlineReg.exec(value)) { |
| 209 | html = "<strong><code><ins><hr></ins></code></strong>"; |
| 210 | } else if (strongColorVlineReg.exec(value)) { |
| 211 | html = "<strong><code><mark><hr></mark></code></strong>"; |
| 212 | } else if (strongHlineReg.exec(value)) { |
| 213 | html = "<strong><ins><hr></ins></strong>"; |
| 214 | } else if (strongVlineReg.exec(value)) { |
| 215 | html = "<strong><mark><hr></mark></strong>"; |
| 216 | } else if (colorHlineReg.exec(value)) { |
| 217 | html = "<code><ins><hr></ins></code>"; |
| 218 | } else if (colorVlineReg.exec(value)) { |
| 219 | html = "<code><mark><hr></mark></code>"; |
| 220 | } else if (hlineReg.exec(value)) { |
| 221 | html = "<ins><hr></ins>"; |
| 222 | } else if (vlineReg.exec(value)) { |
| 223 | html = "<mark><hr></mark>"; |
| 224 | } |
| 225 | return html; |
| 226 | }; |
| 227 | |
| 228 | /** |
| 229 | * 创建并下载文件 |