Module:Diff/sandbox: Difference between revisions

Content deleted Content added
Fix? maybe??
author per current c:Module:Diff; remove trailing whitespace
Line 4:
-- (c) 2007, 2008 Yuri Takhteyev (yuri@freewisdom.org)
-- (c) 2007 Hisham Muhammad
-- Adapted to MediaWiki LUA:Lua originally by [[User:Ebraminio]] <ebrahim -at- gnu.org>Ebrahim
--
-- License: MIT/X, see http://sputnik.freewisdom.org/en/License
Line 23:
-- @param separator [optional] the separator pattern (defaults to any
-- whitespace - %s+).
-- @param skip_separator [optional] don't include the separator in the results.
-- @return A list of tokens.
-----------------------------------------------------------------------------
local function split(text, separator, skip_separator)
separator = separator or "%s+"
local parts = {}
local start = 1
local split_start, split_end = mw.ustring.find(text, separator, start)
Line 48:
-----------------------------------------------------------------------------
-- Derives the longest common subsequence of two strings. This is a faster
-- implementation than one provided by stdlib. Submitted by Hisham Muhammad.
-- The algorithm was taken from:
-- http://en.wikibooks.org/wiki/Algorithm_implementation/Strings/Longest_common_subsequence
Line 97:
-----------------------------------------------------------------------------
-- Formats an inline diff as HTML, with <ins> and <del> tags.
--
-- @param tokens a table of {token, status} pairs.
-- @return an HTML string.
Line 111:
elseif status == "out" then
diff_buffer = diff_buffer..'<del>'..token..'</del>'
else
diff_buffer = diff_buffer..token
end