Module:UpdateExcerpt: Difference between revisionsGive feedback
Added __NOEDITSECTION__ so the preview no longer shows edit buttons |
Performance optimizations |
||
| Line 24: | Line 24: | ||
end | end | ||
local | local notesRaw = content:match("|%s*notes%s*=(.*)") | ||
if not | if not notesRaw then | ||
return '<span class="error">No notes parameter found on [[' .. pageTitle .. ']]</span>' | return '<span class="error">No notes parameter found on [[' .. pageTitle .. ']]</span>' | ||
end | end | ||
notesRaw = notesRaw:gsub("%s*}}%s*$", "") | |||
notesRaw = mw.text.trim(notesRaw) | notesRaw = mw.text.trim(notesRaw) | ||
| Line 46: | Line 38: | ||
local maxHeight = maxLines * 1.7 | local maxHeight = maxLines * 1.7 | ||
local html = string.format( | |||
'<div style="flex:1; min-height:0; overflow-y:auto; max-height:%.1fem; padding:14px 18px; font-family: sans-serif; font-size:0.92em; line-height:1.7;">\n__NOEDITSECTION__\n%s\n</div>', | |||
maxHeight, | |||
frame:preprocess(notesRaw) | |||
) | |||
return html | return html | ||