Download frontend/src/utils/htmlParser/index.ts from CatPtain/web_ppt: direct link, hf CLI and curl.
- Browser
- Download file 410 Bytes
-
https://huggingface.co/spaces/CatPtain/web_ppt/resolve/main/frontend/src/utils/htmlParser/index.ts
- Command line
-
hf download hf://spaces/CatPtain/web_ppt/frontend/src/utils/htmlParser/index.ts
-
curl -L -o index.ts https://huggingface.co/spaces/CatPtain/web_ppt/resolve/main/frontend/src/utils/htmlParser/index.ts
410 Bytes
| // 参考:https://github.com/andrejewski/himalaya 用TypeScript重写并简化部分功能 | |
| import { lexer } from './lexer' | |
| import { parser } from './parser' | |
| import { format } from './format' | |
| import { toHTML } from './stringify' | |
| export type { AST } from './types' | |
| export const toAST = (str: string) => { | |
| const tokens = lexer(str) | |
| const nodes = parser(tokens) | |
| return format(nodes) | |
| } | |
| export { toHTML } | |