Module:Lang: Difference between revisions
Jump to navigation
Jump to search
sync from sandbox per edit request;
BalkanMapper (talk | contribs) m (1 revision imported) |
Track listing>Trappist the monk (sync from sandbox per edit request;) |
||
| Line 840: | Line 840: | ||
If text contains <poem>...</poem> stripmarker, return text unmodified and choose <div>..</div> tags because | If text contains <poem>...</poem> stripmarker, return text unmodified and choose <div>..</div> tags because | ||
the stripmarker is replaced with text wrapped in <div>..</div> tags. | the stripmarker is replaced with text wrapped in <div>..</div> tags. | ||
If the text contains any actual <div>...</div> tags, then it's again returned unmodified and <div>...</div> | |||
tags are used to wrap it, to prevent div/span inversion. | |||
]] | ]] | ||
| Line 848: | Line 851: | ||
if has_poem_tag (text) then -- contains poem stripmarker (we can't know the content of that) | if has_poem_tag (text) then -- contains poem stripmarker (we can't know the content of that) | ||
tag = 'div'; -- poem replacement is in div tags so lang must use div tags | tag = 'div'; -- poem replacement is in div tags so lang must use div tags | ||
elseif text:find ('<div') then -- reductive; if the text contains a div tag, we must use div tags | |||
tag = 'div'; | |||
elseif mw.text.trim (text):find ('\n\n+') then -- contains implied p tags | elseif mw.text.trim (text):find ('\n\n+') then -- contains implied p tags | ||
text = mw.text.trim (text); -- trim leading and trailing whitespace characters | text = mw.text.trim (text); -- trim leading and trailing whitespace characters | ||