Content deleted Content added
right |
order |
||
Line 254:
-- Dash with possible whitespace or Date separator (dash without whitespace)
foundPositionStart, foundPositionEnd, foundMatch = mw.ustring.find(seekString, '^(
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
return ELEMENT_DASH, foundMatch, (currentPosition > mw.ustring.len(seekString))▼
if (foundMatch == '-') then -- nothing else is date separator, no hyphens no stuff like that▼
return ELEMENT_DATESEPARATOR, foundMatch, (currentPosition > mw.ustring.len(seekString))▼
else▼
return ELEMENT_DASH, foundMatch, (currentPosition > mw.ustring.len(seekString)) -- we will actually need to check for DATESEPARATOR as well, as that one stole the '-' case▼
end▼
end
--
foundPositionStart, foundPositionEnd, foundMatch = mw.ustring.find(seekString, '^( [%-–—]%s*)', currentPosition)
if (foundPositionStart) then
Line 270 ⟶ 266:
return ELEMENT_DASH, foundMatch, (currentPosition > mw.ustring.len(seekString))
end
--
foundPositionStart, foundPositionEnd, foundMatch = mw.ustring.find(seekString, '^( &[
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
return ELEMENT_DASH, foundMatch, (currentPosition > mw.ustring.len(seekString))
end
--
foundPositionStart, foundPositionEnd, foundMatch = mw.ustring.find(seekString, '^(
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
return ELEMENT_DASH, foundMatch, (currentPosition > mw.ustring.len(seekString))
end
--
foundPositionStart, foundPositionEnd, foundMatch = mw.ustring.find(seekString, '^(
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
return ELEMENT_DASH, foundMatch, (currentPosition > mw.ustring.len(seekString))
end
-- Regular whitespace
▲ -- Same but dash entity code and both non-breaking spaces - ' – '
foundPositionStart, foundPositionEnd, foundMatch = mw.ustring.find(seekString, '^(
if (foundPositionStart) then
currentPosition = foundPositionEnd + 1 -- this is our new start ___location
▲ return ELEMENT_DASH, foundMatch, (currentPosition > mw.ustring.len(seekString))
▲ if (foundMatch == '-') then -- nothing else is date separator, no hyphens no stuff like that
▲ return ELEMENT_DATESEPARATOR, foundMatch, (currentPosition > mw.ustring.len(seekString))
▲ else
▲ return ELEMENT_DASH, foundMatch, (currentPosition > mw.ustring.len(seekString)) -- we will actually need to check for DATESEPARATOR as well, as that one stole the '-' case
▲ end
end
|