Modul:Citation/utilities: Unterschied zwischen den Versionen
+ci.texts.wrongChars
K (+soft hyphen) |
(+ci.texts.wrongChars) |
||
| Zeile 8: | Zeile 8: | ||
-- module variable | -- module variable | ||
local cu = {} | local cu = {} | ||
-- module import | |||
local ci = require( 'Module:Citation/i18n' ) | |||
-- global variable | -- global variable | ||
| Zeile 104: | Zeile 107: | ||
return s | return s | ||
end | end | ||
local orig = s | |||
-- replace control characters | -- replace control characters | ||
s = s:gsub( '[\009\010\013]', ' ' ) -- horizontal tab, line feed, carriage return | s = s:gsub( '[\009\010\013]', ' ' ) -- horizontal tab, line feed, carriage return | ||
| Zeile 112: | Zeile 117: | ||
s = mw.ustring.gsub( s, '</*p[^/>]*/*>', '' ) -- <p> tag | s = mw.ustring.gsub( s, '</*p[^/>]*/*>', '' ) -- <p> tag | ||
s = mw.ustring.gsub( s, '</*div[^/>]*/*>', '' ) -- <div> tag | s = mw.ustring.gsub( s, '</*div[^/>]*/*>', '' ) -- <div> tag | ||
if orig ~= s then | |||
cu.addErrorMsg( ci.texts.wrongChars ) | |||
end | |||
-- replace characters | -- replace characters | ||