Changes
Refactor, fix fragment links for ships without page aliases
_arrow = "⇒",
_arrow = "⇒",
_question_marks = "??",
_question_marks = "??",
_fragment_prefix = "shipremodelistkai",
}
}
function ShipRemodelListKai:name(ship)
function ShipRemodelListKai:name(ship)
return {values = {value = tostring(mw.html.create('span'):attr('id', "shipremodellistkai-" .. tostring(ship:api_id() or mw.ustring.lower(mw.ustring.gsub(text, "%s+")))):wikitext(Formatting:format_link(ship:link())))}, bg_color = self._transparent, text_align = self._center_align}
return {values = {value = Formatting:id_span(tostring(ship:api_id() or mw.ustring.lower(mw.ustring.gsub(ship:name(), "%s+"))), self._fragment_prefix, Formatting:format_link(ship:link()))}, bg_color = self._transparent, text_align = self._center_align}
end
end
local name_after = self._remodel_to == nil and self._question_marks or self._dash
local name_after = self._remodel_to == nil and self._question_marks or self._dash
if self._remodel_to then
if self._remodel_to then
name_after = Formatting:fragment_link(tostring(self._remodel_to:api_id() or mw.ustring.lower(mw.ustring.gsub(self._remodel_to:name(), "%s+"))), self._fragment_prefix, self._remodel_to:name())
name_after = Formatting:format_link("", text, "shipremodellistkai-" .. tostring(self._remodel_to:api_id() or mw.ustring.lower(mw.ustring.gsub(text, "%s+"))))
end
end
return {values = {value = name_after}, bg_color = self._transparent, text_align = self._center_align}
return {values = {value = name_after}, bg_color = self._transparent, text_align = self._center_align}