Fossil

View Ticket
Login

View Ticket

2020-11-25
21:57 Fixed ticket [4e558dbf3d]: Single quote in wiki page title results in bad link from timeline, x(wiki:y'z) plus 4 other changes ... (artifact: 6bcdaad988 user: drh)
21:45
Fix the "fossil timeline" command so that it works with the new EVENT.COMMENT format for wiki page changes. Ticket [4e558dbf3d2511ce]. ... (check-in: 471443b464 user: drh tags: trunk)
21:22
Change the way that wiki edits are stored in the Event table in order to address ticket [4e558dbf3d2511ce]. The Event.comment field for a wiki page change now stores just the raw name of the wiki page prefixed with a single character "+", "-", or ":" to indicate if the page was added, deleted, or modified, respectively. Formatting is handled by the timeline rendering. <b>A "fossil rebuild" is required.</b> The "timeline" command is not yet fixed. ... (check-in: 1a9b1c4de7 user: drh tags: trunk)
20:06 Wiki page "Test of single-quote in wiki's title" ... (artifact: e5197770c7 user: drh)
2020-11-24
05:41 Ticket [4e558dbf3d] Single quote in wiki page title results in bad link from timeline, x(wiki:y'z) status still Open with 5 other changes ... (artifact: f0561a6f76 user: ivz_hh)
2020-09-28
14:47 New ticket [4e558dbf3d]. ... (artifact: 587f0400e6 user: dbohdan)

Ticket Hash: 4e558dbf3d2511ce5dbe52897900760da95fd272
Title: Single quote in wiki page title results in bad link from timeline, [x](wiki:y'z)
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Resolution: Fixed
Last Modified: 2020-11-25 21:57:54
Version Found In: 2.12.1
User Comments:
dbohdan added on 2020-09-28 14:47:55:

I have created a wiki page with a single quote character in the title on my site. When I look at the timeline, the link to the wiki page is broken: the single quote is escaped twice.

<span class='timelineModernComment'>
Changes to wiki page <a href="/wiki?name=Goethe%26%2339%3Bs+Poems+translated+by+Paul+Dyrsen">Goethe&#39;s Poems translated by Paul Dyrsen</a>
</span>

It is also a problem to link to this page with the [](wiki:) syntax. [foo](Goethe's Poems translated by Paul Dyrsen) translates to <a href="/wiki?name=Goethe%27">foo</a>. Escaping the single quote with a slash does not change that.

A fresh Fossil repository with the issue.


ivz_hh added on 2020-11-24 05:41:32:

get_link_inline recognizes quote as start of title. This code tries to accept escaped quote.

Index: src/markdown.c
==================================================================
--- src/markdown.c
+++ src/markdown.c
@@ -932,11 +932,11 @@
   /* skipping initial whitespace */
   while( i<size && (data[i]==' ' || data[i]=='\t' || data[i]=='\n') ){ i++; }
   link_b = i;
 
   /* looking for link end: ' " */
-  while( i<size && data[i]!='\'' && data[i]!='"' ){ i++; }
+  while( i<size && (data[i]!='\'' && data[i]!='"' || (0<i && data[i-1]=='\\')) ){ i++; }
   link_e = i;
 
   /* looking for title end if present */
   if( data[i]=='\'' || data[i]=='"' ){
     i++;