Call *dtext–match-links with args: ~last nil t [nil]~[fn:1]
pattern
= conditions:
- markdown is nil
- wiki is t
- url-link is nil
therefore: dtext-link-wiki-regexp
Get match groups 1 (text) and 2 (URL).
If there is match for the text, add the appropriate text properties to the characters within that range. Similarly, if there is a match for the URL, set those characters’ properties as well.
Prohibited faces:
- dtext-code-face
Iterate through a loop with three conditions:
- No match found
- Point has not reached the end of the search region (last)
- Result of a regular expression search forward is non-nill
In the body of the loop, do the following:
Check if any of the characters in the range matched by said regular expression have one or more from a list of prohibited faces. If so, the match data is cleared.
[IF BLOCK 1]
If there is a match, the match data will be structured like this:
- URL links
- nil
- URL
- Wiki links
- URL
- text
- DText and Markdown links
- text
- URL
But in each of these cases, the match data is modified to make group 1 the text and group 2 the URL.
At the end,
[END IF BLOCK 1]
[fn:1] Bracketed args are optional args that have been omitted; their defaults were used.