luci/contrib/package
Jo-Philipp Wich 5c5f4a8d1f contrib: introduce ucode-mod-html
The ucode-mod-html library provides assorted utility functions for dealing
with HTML markup data.

Example usage:

    #!/usr/bin/ucode

    'use strict';

    import { tokenize, striptags, entitydecode, entityencode,
             OPEN, ATTR, TEXT, CLOSE, RAW, COMMENT, CDATA, PROCINST, EOF } from 'html';

    tokenize('<div class="example">Hello world!</div>...',
        function(type, text, value) {
            switch (type) {
            case OPEN:     print(`Opening tag: ${text}\n`); break;
            case ATTR:     print(`Attribute:   ${text}${value ? `=${value}`}\n`; break;
            case TEXT:     print(`Text data:   ${text}\n`); break;
            case CLOSE:    print(`Closing tag: ${text}\n`); break;
            case RAW:      print(`Script/CSS:  ${text}\n`); break;
            case COMMENT:  print(`Comment:     ${text}\n`); break;
            case CDATA:    print(`CDATA text:  ${text}\n`); break;
            case PROCINST: print(`<!...> tag:  ${text}\n`); break;
            case EOF:      print(`End of input\n`);         break;
            }
        }
    );

    print(striptags('<p>This is some <b>text</b> with <br> markup</p>\n'));
    print(entitydecode('&#60; &#x20; &amp; &auml;'));
    print(entityencode('1 < 2 && "foo"'));

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-25 01:03:36 +02:00
..
csstidy csstidy: update to latest Git HEAD 2021-06-13 19:54:36 +02:00
lucihttp lucihttp: update to latest Git HEAD 2022-07-08 15:26:23 +02:00
ucode-mod-html contrib: introduce ucode-mod-html 2022-10-25 01:03:36 +02:00
ucode-mod-lua ucode-mod-lua: improve error reporting 2022-10-25 01:03:36 +02:00
Makefile Rewrote host environment targets to work out of the box 2008-07-24 13:55:11 +00:00