Modify

Opened 10 years ago

Last modified 12 months ago

#1799 new defect

[Patch] {p1} doesn't work as expected and :\ is not a good smiley IMHO

Reported by: Kenneth Xu Owned by: Christian Boos
Priority: low Component: WikiExtrasPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

I think it's very common that I write things like C:\Temp. I prefer to use :-\ instead.

It was {1} in the code, but I couldn't get {p1} to work neither. {#1} works for me.

I have attached the updated smileys.py file.

Attachments (2)

smileys.py (2.5 KB) - added by Kenneth Xu 10 years ago.
1799.patch (1.4 KB) - added by Kenneth Xu 9 years ago.
Patch for both 0.9/0.10 and 0.11 to fix the :\ and {1}

Download all attachments as: .zip

Change History (10)

Changed 10 years ago by Kenneth Xu

Attachment: smileys.py added

comment:1 Changed 10 years ago by Kenneth Xu

BTW, the platform is Windows 2003 Server, python 2.5.1, trac 0.10.4

comment:2 Changed 10 years ago by Christian Boos

Priority: normallow

Well, the r2439 and r2444 changes were for the 0.11-compatible version of the plugin.

Those changes could eventually be backported to the 0.9 branch (which is also 0.10-compatible).

Patch welcomed ;-)

comment:3 Changed 10 years ago by Maverick

How can you escape smileys? I'm having problems with the :/ smiley because I have alot of C:\Bla\Bla paths at my wiki page.

comment:4 Changed 10 years ago by anonymous

:\ smiley *

comment:5 Changed 9 years ago by Kenneth Xu

:\ is fixed in 0.11, seems that it requires a space before : to be qualified as a smiley in 0.11.

But {p1} still doesn't work. Not sure if it is environement related, but we use Windows Server 2003, Python 2.5.2 and Track 0.11.1. I had to use {#1} instead.

I am enclosing the patch for both 0.9 and 0.11 to resolve this problem. Anybody used the smiley.py will need this patch to make everything working in 0.11

Changed 9 years ago by Kenneth Xu

Attachment: 1799.patch added

Patch for both 0.9/0.10 and 0.11 to fix the :\ and {1}

comment:6 Changed 8 years ago by Adrian Fritz

Summary: {p1} doesn't work as expected and :\ is not a good smiley IMHO[Patch] {p1} doesn't work as expected and :\ is not a good smiley IMHO

comment:7 Changed 6 years ago by Mikael Relbe

I also can't get the {p1} smiley to render correctly in my environment. I therefore debugged the wiki formatting code in Trac 0.13dev-r10691 when a {p1} smiley is parsed.

In my environment, it becomes handled by the ticket report module in Trac and not by the smiley component.

A race/conflict seems to arise between the smiley and ticket report modules in that both declares regexps that matches {p1}. Which one that is parsed depends on the order of syntax providers stored in the wiki parser module.

When I reversed the loop that scans the syntax provides, the smiley showed up:

     syntax = self._pre_rules[:]
     i = 0
-    for resolver in WikiSystem(self.env).syntax_providers:
+    for resolver in reversed(WikiSystem(self.env).syntax_providers):
         for regexp, handler in resolver.get_wiki_syntax() or []:
             handlers['i' + str(i)] = handler

The order in which the the wiki syntax providers are scanned matters!

However I can’t explain why it works for some users in the normal case, but not for me. I guess the smiley syntax provider is handled before the one in the ticket report module in some environments.

comment:8 Changed 12 months ago by Ryan J Ollos

Component: WikiGoodiesPluginWikiExtrasPlugin

Move tickets from deprecated plugin to superseding plugin. These probably need to be triaged.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Christian Boos.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.