[pmwiki-users] Fixme icon
Robert Riebisch
rr at bttr-software.de
Fri Jan 10 13:45:30 PST 2020
Hi Petko,
>> Put this to config.php:
>>
>> Markup('FIXME', 'directives', '/\\(:FIXME:\\)/',
>> "$PubDirUrl/fixme.gif\"FIXME\"");
>>
>> *And* this to pub/css/local.css:
>>
>> img[src$="fixme.gif"] { vertical-align: middle; }
>>
>> ?
>
> Yes.
Okay.
>> Is
>> img[src$="fixme.gif"] { vertical-align: middle; }
>> something special from PmWiki or is it a CSS feature?
>>
>> I've never seen that syntax before?
>
> It is a CSS feature, "img tags with attribute src ending with
> fixme.gif", see:
>
> https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors
Ah. Thanks!
[snip]
> Try to make your local.css work, it is a very useful feature (also
> assumed to work by many addons).
It was already working for .diffmarkup and simpletable styling.
Now it also works for the FIXME icon.
Not sure, what happened.
I think, I just didn't notice or looked at the wrong place. Probably
need more sleep. ;-)
As I'm not very familiar with RegExp it took my some hours on
<https://regexr.com/> to create an ROE Pattern to replace FIXME with
(:FIXME:)
$ROEPatterns['/(^|\\n| )\\b(FIXME)\\b( ?)/'] = '\\1(:\\2:)\\3';
It seems to work for me now, but is it really right on edge cases?
My test cases:
#####
FIXME
^^^^^ At the beginning (match:)
Standalone (match):
FIXME
Already replaced (no match):
(:FIXME:)
In the middle of a word (no match):
fooFIXMEbar
Lowercase (no match):
fixme
Indented by 1 space (match):
FIXME
Indented by 2 spaces (match):
FIXME
Indented by 1 TAB (no match):
FIXME
Indented and followed by spaces (match):
FIXME
Somewhere in a text (match):
Foo FIXME bar.
End the end (match):
FIXME
#####
Cheers,
Robert
--
+++ BTTR Software +++
Home page: https://www.bttr-software.de/
DOS ain't dead: https://www.bttr-software.de/forum/
More information about the pmwiki-users
mailing list