So let’s walk so code and see how this stuff works. Think if it as me rambling as I work out the issues.
In src/changes.c
we have the code that handles the --html
flag:
longopt lopts[] = {
{ "no-meta", 300 }, /* don't show meta files */
/* seems more like --no attr */
{ "html", 301 }, /* old -h */
...
while ((c =
getopt(ac, av, "0123456789aBc;Dd;efi;kLmnPqRr;StTu;U;Vv/;x;",
lopts)) != -1) {
unless (c == 'L' || c == 'R' || c == 'D' || c == 302) {
nav = bk_saveArg(nav, av, c);
}
switch (c) {
...
case 301: opts.html = 1; opts.urls = 0; break;
}
So it sets opts.html
. (opts.urls
is the -q option which is also implied)
And later we have this:
unless (opts.dspec) {
if (opts.html) {
spec = opts.verbose ?
"dspec-changes-hv" :
"dspec-changes-h";
So when you don’t specify the dspec to changes explicitly that lists the file that it used to for the default output of this command.
src/dspec-changes-h
looks like this:
# the default dspec used by 'bk changes --html'
# Note: Do not use :USERHOST: as :USER:@:HOST will print @ if no host
$begin {
"<html><body bgcolor=white>\n"
"<table align=center bgcolor=black cellspacing=0 "
"border=0 cellpadding=0>"
"<tr><td>\n"
"<table width=100% cellspacing=1 border=0 cellpadding=1>"
"<tr><td>\n"
}
"<tr bgcolor=lightblue>"
"<td font size=4>"
" :Dy:-:Dm:-:Dd: :Th:::Tm: :USER:@:HOST: :REV:"
"</td>"
"</tr>\n"
$if (:TAGS:) {
"<tr bgcolor=yellow>"
"<td>"
$each(:TAGS:) {
" TAG: (:TAGS:)<br>\n"
}
"</td>"
"</tr>\n"
}
"<tr bgcolor=white>"
"<td>"
$each(:C:) {
" (:C:)<br>\n"
}
"</td>"
"</tr>\n"
$end {
"</td></tr></table></table></body></html>\n"
}
As you can see your problem HTML was written by an old C hacker who learned HTML in '97. (@mcvoy)
The first problem can be fixed in that file. The second problem was with the rendering the comments section:
$each(:C:) {
" (:C:)<br>\n"
}
Try replacing that whole block with just :HTML_C: which is coded in src/slib.c:15430
If you get a fix that works, fix the src/dspec-changes-hv
file too and then put them in a gist and link them here. I will check them into the bk://bkbits.net/bk/dev
branch that holds the not yet released changes.