View source for Module:ApplyLinkAnnotations

MyWikiBiz, Author Your Legacy — Saturday July 26, 2025
Jump to navigationJump to search

You do not have permission to edit this page, for the following reasons:

  • The action you have requested is limited to users in one of the groups: Users, vuser.
  • You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page.

local p = {};
local regex = "(:*)%*%s*%[%[([^%]|:][^%]:]*[^%]|:])%]%]%s*"
local repl = "%1* {{Annotated link |%2}}"
function p.replaceLinksInUnorderedList(markup)
-- provided for convenience to make console testing easier for development
--
-- matches any wikilinks that are
-- 1. at the beginning of a list item
-- 2. with no existing annotation (or any text) following them
--
-- must run twice because match utilizes the newlines on *both* sides
-- of wikilinks and thus, "consumes" those chars during the first match
-- such that every-other line is ineligible for matching until the second
-- run. (which does the same thing but for all the other lines)
-- Test case(s?):
-- =p.replaceLinksInUnorderedList("\n*[[TEst|teST]] \n:* [[name]]\n::*[[link]] - with existing annotation\n::* [[for|a friend]] \n*[[t]]\n")
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
000
1:0
Debug console
* The module exports are available as the variable "p", including unsaved modifications. * Precede a line with "=" to evaluate it as an expression or use print(). Use mw.logObject() for tables. * Use mw.log() and mw.logObject() in module code to send messages to this console.

Return to Module:ApplyLinkAnnotations.