<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.digitalcellulose.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AHTMLParser</id>
	<title>Module:HTMLParser - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.digitalcellulose.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AHTMLParser"/>
	<link rel="alternate" type="text/html" href="http://www.digitalcellulose.com/wiki/index.php?title=Module:HTMLParser&amp;action=history"/>
	<updated>2026-06-11T02:05:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://www.digitalcellulose.com/wiki/index.php?title=Module:HTMLParser&amp;diff=152547&amp;oldid=prev</id>
		<title>Adminsuzy: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://www.digitalcellulose.com/wiki/index.php?title=Module:HTMLParser&amp;diff=152547&amp;oldid=prev"/>
		<updated>2020-09-13T20:47:22Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 20:47, 13 September 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Adminsuzy</name></author>
		
	</entry>
	<entry>
		<id>http://www.digitalcellulose.com/wiki/index.php?title=Module:HTMLParser&amp;diff=152546&amp;oldid=prev</id>
		<title>Imported&gt;Rillke: ←Created page with '--[[ 	(The MIT license) 	Copyright (c) 2013, Wouter Scherphof (wouter.scherphof@gmail.com) 	Permission is hereby granted, free of charge, to any person obtainin...'</title>
		<link rel="alternate" type="text/html" href="http://www.digitalcellulose.com/wiki/index.php?title=Module:HTMLParser&amp;diff=152546&amp;oldid=prev"/>
		<updated>2013-11-21T13:01:20Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/wiki/index.php?title=COM:AES&amp;amp;action=formedit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;COM:AES (page does not exist)&quot;&gt;←&lt;/a&gt;Created page with &amp;#039;--[[ 	(The MIT license) 	Copyright (c) 2013, Wouter Scherphof (wouter.scherphof@gmail.com) 	Permission is hereby granted, free of charge, to any person obtainin...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[&lt;br /&gt;
	(The MIT license)&lt;br /&gt;
	Copyright (c) 2013, Wouter Scherphof (wouter.scherphof@gmail.com)&lt;br /&gt;
	Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &amp;quot;Software&amp;quot;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:&lt;br /&gt;
	The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.&lt;br /&gt;
	THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
-- Source: https://github.com/wscherphof/lua-htmlparser/tree/master/src&lt;br /&gt;
&lt;br /&gt;
local ElementNode = require(&amp;quot;Module:HTMLParser/ElementNode&amp;quot;)&lt;br /&gt;
local voidelements = require(&amp;quot;Module:HTMLParser/voidelements&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local HtmlParser = {}&lt;br /&gt;
&lt;br /&gt;
local function parse(text)&lt;br /&gt;
  local root = ElementNode:new(text)&lt;br /&gt;
&lt;br /&gt;
  local node, descend, tpos, opentags = root, true, 1, {}&lt;br /&gt;
  while true do&lt;br /&gt;
    local openstart, name&lt;br /&gt;
    openstart, tpos, name = string.find(root._text,&lt;br /&gt;
      &amp;quot;&amp;lt;&amp;quot; .. -- an uncaptured starting &amp;quot;&amp;lt;&amp;quot;&lt;br /&gt;
      &amp;quot;(%w+)&amp;quot; .. -- name = the first word, directly following the &amp;quot;&amp;lt;&amp;quot;&lt;br /&gt;
      &amp;quot;[^&amp;gt;]*&amp;gt;&amp;quot;, -- include, but not capture everything up to the next &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
    tpos)&lt;br /&gt;
    if not name then break end&lt;br /&gt;
    local tag = ElementNode:new(name, node, descend, openstart, tpos)&lt;br /&gt;
    node = tag&lt;br /&gt;
&lt;br /&gt;
    local tagst, apos = tag:gettext(), 1&lt;br /&gt;
    while true do&lt;br /&gt;
      local start, k, eq, quote, v&lt;br /&gt;
      start, apos, k, eq, quote = string.find(tagst,&lt;br /&gt;
        &amp;quot;%s+&amp;quot; .. -- some uncaptured space&lt;br /&gt;
        &amp;quot;([^%s=/&amp;gt;]+)&amp;quot; .. -- k = an unspaced string up to an optional &amp;quot;=&amp;quot; or the &amp;quot;/&amp;quot; or &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
        &amp;quot;(=?)&amp;quot; .. -- eq = the optional; &amp;quot;=&amp;quot;, else &amp;quot;&amp;quot;&lt;br /&gt;
        &amp;quot;(['\&amp;quot;]?)&amp;quot;, -- quote = an optional &amp;quot;'&amp;quot; or '&amp;quot;' following the &amp;quot;=&amp;quot;, or &amp;quot;&amp;quot;&lt;br /&gt;
      apos)&lt;br /&gt;
      if not k or k == &amp;quot;/&amp;gt;&amp;quot; or k == &amp;quot;&amp;gt;&amp;quot; then break end&lt;br /&gt;
      if eq == &amp;quot;=&amp;quot; then&lt;br /&gt;
        local pattern = &amp;quot;=([^%s&amp;gt;]*)&amp;quot;&lt;br /&gt;
        if quote ~= &amp;quot;&amp;quot; then&lt;br /&gt;
          pattern = quote .. &amp;quot;([^&amp;quot; .. quote .. &amp;quot;]*)&amp;quot; .. quote&lt;br /&gt;
        end&lt;br /&gt;
        start, apos, v = string.find(tagst, pattern, apos)&lt;br /&gt;
      end&lt;br /&gt;
      tag:addattribute(k, v or &amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if voidelements[string.lower(tag.name)] then&lt;br /&gt;
      descend = false&lt;br /&gt;
      tag:close()&lt;br /&gt;
    else&lt;br /&gt;
      opentags[tag.name] = opentags[tag.name] or {}&lt;br /&gt;
      table.insert(opentags[tag.name], tag)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local closeend = tpos&lt;br /&gt;
    while true do&lt;br /&gt;
      local closestart, closing, closename&lt;br /&gt;
      closestart, closeend, closing, closename = string.find(root._text, &amp;quot;[^&amp;lt;]*&amp;lt;(/?)(%w+)&amp;quot;, closeend)&lt;br /&gt;
      if not closing or closing == &amp;quot;&amp;quot; then break end&lt;br /&gt;
      tag = table.remove(opentags[closename])&lt;br /&gt;
      closestart = string.find(root._text, &amp;quot;&amp;lt;&amp;quot;, closestart)&lt;br /&gt;
      tag:close(closestart, closeend + 1)&lt;br /&gt;
      node = tag.parent&lt;br /&gt;
      descend = true&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  return root&lt;br /&gt;
end&lt;br /&gt;
HtmlParser.parse = parse&lt;br /&gt;
&lt;br /&gt;
return HtmlParser&lt;/div&gt;</summary>
		<author><name>Imported&gt;Rillke</name></author>
		
	</entry>
</feed>