<feed xmlns='http://www.w3.org/2005/Atom'>
<title>luci/contrib/package/ucode-mod-html, branch master</title>
<subtitle>Lua Configuration Interface (mirror)</subtitle>
<id>https://git-03.infra.openwrt.org/project/luci/atom?h=master</id>
<link rel='self' href='https://git-03.infra.openwrt.org/project/luci/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/luci/'/>
<updated>2023-08-08T18:49:31Z</updated>
<entry>
<title>ucode-mod-html: fix build with gcc 5</title>
<updated>2023-08-08T18:49:31Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2023-08-08T18:49:31Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/luci/commit/?id=b3d661cd84760a0cdf084a25f21556a07e369d33'/>
<id>urn:sha1:b3d661cd84760a0cdf084a25f21556a07e369d33</id>
<content type='text'>
Older gcc versions raise a `label at end of compound statement` error due
to the empty default case. Fix the problem by adding an explicit `break`
statement.

Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>contrib: introduce ucode-mod-html</title>
<updated>2022-10-24T23:03:36Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2022-09-02T15:04:42Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/luci/commit/?id=5c5f4a8d1f4560b5c0ac90402f5f957b166c96a3'/>
<id>urn:sha1:5c5f4a8d1f4560b5c0ac90402f5f957b166c96a3</id>
<content type='text'>
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('&lt;div class="example"&gt;Hello world!&lt;/div&gt;...',
        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(`&lt;!...&gt; tag:  ${text}\n`); break;
            case EOF:      print(`End of input\n`);         break;
            }
        }
    );

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

Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
</feed>
