CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
1import type {Position} from 'unist'2import type {VFile} from 'vfile'3 4export {fromParse5} from './lib/index.js'5 6/**7 * Configuration.8 */9export interface Options {10  /**11   * File used to add positional info to nodes (optional).12   *13   * If given, the file should represent the original HTML source.14   */15  file?: VFile | null | undefined16 17  /**18   * Which space the document is in (default: `'html'`).19   *20   * When an `<svg>` element is found in the HTML space, this package already21   * automatically switches to and from the SVG space when entering and exiting22   * it.23   */24  space?: Space | null | undefined25 26  /**27   * Whether to add extra positional info about starting tags, closing tags,28   * and attributes to elements (default: `false`).29   *30   * > ๐Ÿ‘‰ **Note**: only used when `file` is given.31   */32  verbose?: boolean | null | undefined33}34 35/**36 * Namespace.37 */38export type Space = 'html' | 'svg'39 40// Register data on hast.41declare module 'hast' {42  interface ElementData {43    position: {44      /**45       * Positional info of the start tag of an element.46       *47       * Field added by `hast-util-from-parse5` (a utility used inside48       * `rehype-parse` responsible for parsing HTML), when passing49       * `verbose: true`.50       */51      opening?: Position | undefined52 53      /**54       * Positional info of the end tag of an element.55       *56       * Field added by `hast-util-from-parse5` (a utility used inside57       * `rehype-parse` responsible for parsing HTML), when passing58       * `verbose: true`.59       */60      closing?: Position | undefined61 62      /**63       * Positional info of the properties of an element.64       *65       * Field added by `hast-util-from-parse5` (a utility used inside66       * `rehype-parse` responsible for parsing HTML), when passing67       * `verbose: true`.68       */69      properties?: Record<string, Position | undefined> | undefined70    }71  }72 73  interface RootData {74    /**75     * Whether the document was using quirksmode.76     *77     * Field added by `hast-util-from-parse5` (a utility used inside78     * `rehype-parse` responsible for parsing HTML).79     */80    quirksMode?: boolean | undefined81  }82}83 
basant307/AI_Governance_Project ยท CoolFace