Download src/lib/export/html-parser/index.ts from muthuk1/OpenMAIC-React: direct link, hf CLI and curl.
- Browser
- Download file 439 Bytes
-
https://huggingface.co/muthuk1/OpenMAIC-React/resolve/f56a29bb577c3dbea4b71ec00b9720e408aa1469/src/lib/export/html-parser/index.ts
- Command line
-
hf download hf://muthuk1/OpenMAIC-React@f56a29bb577c3dbea4b71ec00b9720e408aa1469/src/lib/export/html-parser/index.ts
-
curl -L -o index.ts https://huggingface.co/muthuk1/OpenMAIC-React/resolve/f56a29bb577c3dbea4b71ec00b9720e408aa1469/src/lib/export/html-parser/index.ts
439 Bytes
| // Reference: https://github.com/andrejewski/himalaya — rewritten in TypeScript with simplified functionality | |
| 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 }; | |