Skip to content

INQParser.js

kyleady edited this page Jan 24, 2017 · 1 revision

Purpose

A single prototype that standardizes the way in which the notes/bio/gmnotes of characters and handouts are parsed.

Usage

new INQParser(object)

Upon creation of the INQParser, it can take a Roll20 handout or character. It will break the bio and gmnotes by line. Each line will be stored as a Table, Rule, List, List Item, or Misc Content.

  • Tables contain both the <table> and </table> HTML tags. Any text preceding these tags on this line is recorded as the name of the table. The contents of the table are parsed into an array of arrays.

  • Rules begin with a title between the HTML tags <strong> and </strong> immediately followed by a colon and the rule's text.

  • Lists are nothing but the title between the HTML tags <strong> and </strong>.

  • If a line doesn't fit any of the above it will be placed in the currently opened List as a List Item. If a List is not open, it will be placed in the Misc Content.

Requirements

-

Clone this wiki locally