Fossil Forum

schelte 1 week, 1 day ago

Post: Ticket view shows <verbatim-... links> tags for plain text descriptions and comments.

The Tcl core machine (core.tcl-lang.org) is running fossil version 2.29 [859458555b]. Now tickets with plain text descriptions and comments show tags. The TH1 code for the ticket view page generates these (and has done for a long time) and passes it to the wiki command. Has something changed in the processing done by the wiki command so it no longer handles these tags and just passes them on? Has this already been fixed in a later commit? I saw no mention of it in the time line.

This is an example of a ticket showing the issue: https://core.tcl-lang.org/tcl/tktview/59cc110ff6.

stephan 1 week, 1 day ago

Has this already been fixed in a later commit?

Apparently an unintended regression, but it's not reproducing for me locally with a local tcl clone and fossil versions or tip-of-trunk, so i'm left scratching my head as to why it happens remotely.

schelte 1 week, 1 day ago

The TH1 code differs from the default, so I tried reverting to default. But even then the verbatim tags still show up.

Is it possible to downgrade the fossil binary to 2.28 or 2.27? Or have there been incompatible changes to the database files that would make it impossible to use them with an older version?

The fossil binary on the machine is owned by the drh account. I don't know if it was actually Richard who updated it and if he did that for a specific reason. So I'm a bit hesitant to go in and change it. But on the other hand, users are complaining.

stephan 1 week, 1 day ago

Is it possible to downgrade the fossil binary to 2.28 or 2.27?

That's almost always possible, but you should run "fossil rebuild" on the repo with 2.27 after doing so, just in case...

Or have there been incompatible changes to the database files that would make it impossible to use them with an older version?

... that happened.

I don't know if it was actually Richard who updated it and if he did that for a specific reason.

My suspicion is currently an inadvertent regression, but i can't say where.

Can you post the th1 code?

schelte 1 week, 1 day ago

There are many repos on the machine, so that would require many rebuilds as well.

Below is the th1 code for the ticket view page. But as I said, the problem also happens with the default code.

<th1>
set alwaysPlaintext [info exists plaintext]
query {SELECT datetime ($tkt_ctime) AS tkt_cdatetime} {}
query {SELECT datetime ($closedate) AS fmt_closedate} {}
query {SELECT rtrim($tkt_uuid,'f')  AS tkt_uuidtrim}  {}
</th1>

<table cellpadding="5">
<tr><td class="tktDspLabel">Ticket&nbsp;UUID:</td>
<th1>
if {[hascap s]} {
    html "<td class='tktDspValue' colspan='3'>$tkt_uuidtrim ($tkt_id)</td>\n"
} else {
    html "<td class='tktDspValue' colspan='3'>$tkt_uuidtrim</td>\n"
}
</th1>
</tr>
<tr>
    <td class="tktDspLabel">Title:</td>
    <td class="tktDspValue" colspan="3">$<title></td>
</tr>
<tr>
    <td class="tktDspLabel">Type:</td>
    <td class="tktDspValue">$<type></td>
    <td class="tktDspLabel">Version:</td>
    <td class="tktDspValue">$<foundin></td>
</tr>
<tr>
    <td class="tktDspLabel">Submitter:</td>
    <td class="tktDspValue">$<submitter></td>
    <td class="tktDspLabel">Created&nbsp;on:</td>
    <td class="tktDspValue">$<tkt_cdatetime></td>
</tr>
<tr>
    <td class="tktDspLabel">Subsystem:</td>
    <td class="tktDspValue">$<subsystem></td>
    <td class="tktDspLabel">Assigned&nbsp;To:</td>
    <td class="tktDspValue">$<assignee></td>
</tr>
<tr>
    <td class="tktDspLabel">Priority:</td>
    <td class="tktDspValue">$<priority></td>
    <td class="tktDspLabel">Severity:</td>
    <td class="tktDspValue">$<severity></td>
</tr>
<tr>
    <td class="tktDspLabel">Status:</td>
    <td class="tktDspValue">$<status></td>
    <td class="tktDspLabel">Last&nbsp;Modified:</td>
    <td class="tktDspValue">$<tkt_datetime></td>
</tr>
<tr>
    <td class="tktDspLabel">Resolution:</td>
    <td class="tktDspValue">$<resolution></td>
    <td class="tktDspLabel">Closed&nbsp;By:</td>
    <td class="tktDspValue">$<closer></td>
</tr>
<tr>
<th1>enable_output [hascap e]</th1>
    <td class="tktDspLabel">Contact:</td>
    <td class="tktDspValue">$<private_contact></td>
<th1>enable_output [expr {![hascap e]}]</th1>
    <td class="tktDspLabel">&nbsp;</td>
    <td class="tktDspValue">&nbsp;</td>
<th1>enable_output 1</th1>
    <td class="tktDspLabel">Closed&nbsp;on:</td>
    <td class="tktDspValue">$<fmt_closedate></td>
</tr>

<th1>
if {[info exists comment] && [string length $comment]>10} {
  html {
    <tr><td class="tktDspLabel" valign=top>Description:</td>
        <td colspan="4" class="tktDspValue">
  }
  # plaintext vs. formatted
  # mimetypes: text/plain, text/html, text/x-fossil-wiki
  #            NOT USED: text/x-fossil-plain
  if {$alwaysPlaintext} {
    set r [randhex]
    if {$cmimetype ne "text/plain"} {html "([htmlize $cmimetype])\n"}
    wiki "<verbatim-$r>[string trimright $comment]</verbatim-$r>\n"
  } elseif {$cmimetype eq "text/plain"} {
    set r [randhex]
    wiki "<verbatim-$r links>[string trimright $comment]</verbatim-$r>\n"
  } elseif {$cmimetype eq "text/x-markdown"} {
    html [lindex [markdown "$comment\n"] 1]
  } elseif {$cmimetype eq "text/x-fossil-wiki"} {
    wiki "<p>\n[string trimright $comment]\n</p>\n"
  } elseif {$cmimetype eq "text/html"} {
    wiki "<p><nowiki>\n[string trimright $comment]\n</nowiki>\n"
  } else {
    set r [randhex]
    wiki "<verbatim-$r links>[string trimright $comment]</verbatim-$r>\n"
  }
  html {</tr>}
}
</th1>

<th1>
set seenRow 0
query {
    SELECT datetime(tkt_mtime) AS xdate,
           login               AS xlogin,
           mimetype            AS xmimetype,
       icomment            AS xcomment,
           username            AS xusername
    FROM  ticketchng
    WHERE tkt_id = $tkt_id
    AND   length(icomment) > 0
    ORDER BY tkt_mtime DESC
} {
  if {$seenRow} {
    html "<hr>\n"
  } else {
    html "<tr><td class='tktDspLabel' valign='top'>User Comments:</td>\n"
    html "    <td colspan='4' class='tktDspValue'>\n"
    set seenRow 1
  }
  if {[info exists showfields]} {
    html "<ul><p>date=$xdate<br>login=$xlogin<br>user=$xusername<br>mime=$xmimetype<br>comment=$xcomment</p></ul>"
  }
  html "[htmlize $xlogin]"
  if {$xlogin ne $xusername && [string length $xusername]>0} {
    html " (claiming to be [htmlize $xusername])"
  }
  html " added on $xdate:\n"
  if {$alwaysPlaintext || $xmimetype eq "text/plain"} {
    set r [randhex]
    if {$xmimetype ne "text/plain"} {html "([htmlize $xmimetype])\n"}
    wiki "<verbatim-$r>[string trimright $xcomment]</verbatim-$r>\n"
  } elseif {$xmimetype eq "text/x-fossil-wiki"} {
    wiki "<p>\n[string trimright $xcomment]\n</p>\n"
  } elseif {$xmimetype eq "text/html"} {
    wiki "<p><nowiki>\n[string trimright $xcomment]\n</nowiki>\n"
  } elseif {$xmimetype eq "text/x-markdown"} {
    html [lindex [markdown "$xcomment\n"] 1]
  } else {
    set r [randhex]
    wiki "<verbatim-$r links>[string trimright $xcomment]</verbatim-$r>\n"
  }
}
if {$seenRow} {html "</td></tr>\n"}
</th1>
</table>
stephan 1 week, 1 day ago

There are many repos on the machine, so that would require many rebuilds as well.

After doing "fossil config pull ticket" on my local tcl clone it repros there (with fossil trunk). If, however, i go to /tktsetup_viewpage and reset to the default, it works as expected.

drh 1 week, 1 day ago

Did you run "fossil config pull all" on the TCL repository in order to pull down their highly customized setup?

schelte 1 week, 1 day ago

I used the web interface https://core.tcl-lang.org/tcl/tktsetup_viewpage and clicked "Revert to default". To restore the original, I pasted the code back into the text box and clicked "Apply Changes".

drh 1 week, 1 day ago

The ticket text contains this markup: <verbatim-ed7093eb87dd50fad08f links>. What are you expecting that markup to do? (The mimetype of the ticket text is text/markdown.)

drh 1 week, 1 day ago

2j@2z,v:

Never mind.... Z 74c969c16a86486e26312bd4ced2a299 1u7jbV;

drh 1 week, 1 day ago
drh 1 week, 1 day ago

A bisect lands on check-in 2026-06-21T14:53:38.727Z - "Expanded the set of "safe HTML" elements to include several harmless ones added to HTML5, which are useful in MD/wiki docs."

drh 1 week, 1 day ago

There is now a ticket for this defect. Warren owns that change. Presumably he will fix the problem soon. I will update the server on core.tcl-lang.org as soon as he accomplishes that.

schelte 1 week, 1 day ago

Excellent! Thanks.

drh 1 week ago

Issue is resolved. The latest trunk check-in of Fossil is now built and is running on the tcl-lang.org website.

schelte 1 week ago

Confirmed. Thanks for the quick fix.

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button