Professional Documents
Culture Documents
Pharser
Pharser
The XYZ JavaScript/HTML parser is a tool for parsing custom HTML tags and
converting them into valid HTML tags. The parser is designed to work with a
specific set of custom tags that are defined by the XYZ project.
Usage
To use the XYZ parser, simply call the parse function and pass in a string of HTML
code. The parser will then scan the input string for custom tags and replace them
with their equivalent HTML tags. Here is an example usage of the parse function:
const input = `
<"hi">
<p"hello world">
<b"this text is bold">
<h1"header 1">
<h3"header 3">
<l<i"item 1"><i"item 2">
<ul<i"item 1"><i"item 2">
<table 2x2<c"1x1"><c"1x2"><c"2x1"><c"2x2">>
`;
console.log(output);
The parse function will return a string of valid HTML code that corresponds to the
input string.
Custom Tags
The XYZ parser supports the following custom HTML tags:
Example
Here is an example input string and its corresponding output after being parsed by
the XYZ parser:
Input String:
<"Welcome to XYZ">
<p"Lorem ipsum dolor sit amet, consectetur adipiscing elit.">
<h1"XYZ Parser">
<ul
<i"Item 1">
<i"Item 2">
<i"Item 3">
>
<table 2x3
<c"1x1">
<c"1x2">
<c"1x3">
<c"2x1">
<c"2x2">
<c"2x3">
>
Output String:
Welcome to XYZ
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<h1>XYZ Parser</h1>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<table>
<tr>
<td>1x1</td> <td>1x2</td> <td>1x3</td>
<td>2x1</td> <td>2x2</td> <td>2x3</td>
</tr>
</table>