_canonical_uri stopped working!!

76 views
Skip to first unread message

oleghbond

unread,
Jan 7, 2020, 9:56:19 AM1/7/20
to TiddlyWiki
I've encountered a serious problem where and when I never expected it. 

Briefly: _canonical_uri images stopped working in a single HTML-file when I build a wiki from Node.js using TW CLI command, type of:

tiddlywiki "D:\boa_protw\_tmp\_ibbXVJ" --rendertiddler $:/plugins/tiddlywiki/tiddlyweb/save/offline "D:\boa_protw\wiki_bag\prosteer\docs\index.html" text/plain

or

tiddlywiki "D:\boa_protw\_tmp\_ibbXVJ" --output "D:\boa_protw\wiki_bag\prosteer\docs" --render "[all[]]" "index_2.html" "text/plain" $:/plugins/tiddlywiki/tiddlyweb/save/offline

Occasionally I noticed the problem a couple of days ago. Before this I generated wikis a lot of times in exactly the same way without any problem.

I checked the image itself. Everything OK with it:

image1.png


image2.png


However, when I try to reveal it via a standard reference a sort of [img[img_name.ext]] I see the following result as of a corrupted link.

image3.png

Do you have anybody an idea what has happened with my environment? At the moment I've no idea!

oleghbond

unread,
Jan 7, 2020, 11:02:38 AM1/7/20
to TiddlyWiki
Meanwhile continuing exploring the case I've just found a probable direct cause of the mishap. The HTML-code of the image tiddler with _canonical_uri field has the following look:

<div _canonical_uri="./images/%2524%253A%252Fboa%252Fimg%252Fprotw-logo.svg" bag="default" created="20200107111510059" modified="20200107111519486" revision="0" title="$:/boa/img/protw-logo.svg" type="image/svg+xml">
<pre>undefined</pre>
</div>

The fragment undefined has immediately drawn my attention. Having removed it the order of things has been restored!

Although I've passed to other issue: what is a cause of this strange word and how to remove it in most proper way?


вівторок, 7 січня 2020 р. 16:56:19 UTC+2 користувач oleghbond написав:

oleghbond

unread,
Jan 7, 2020, 1:21:26 PM1/7/20
to TiddlyWiki
Deeper diving into the issue needed step-by-step investigation:

1) First I did a copy of node.js wiki into a temporary folder:

    xcopy /s/i/q %TW_DIR%\*.* %TMP_DIR%

2) Then I did copying of images into separate folder near the single-file wiki:

    tiddlywiki %TMP_DIR% --savetiddlers %IMG_FILTER% %HTML_IMAGES_DIR%

3) After that in the temporary copy of the wiki two fields _canonical_uri and text were impacted 

    tiddlywiki %TMP_DIR% --setfield %IMG_FILTER% _canonical_uri "$:/core/templates/canonical-uri-external-image" text/plain
    tiddlywiki
%TMP_DIR% --setfield %IMG_FILTER% text "" text/plain

4) The final step was in generation of a single-file HTML wiki from the temporary node.js wiki:

    tiddlywiki %TMP_DIR% --rendertiddler $:/plugins/tiddlywiki/tiddlyweb/save/offline %HTML_INDEX_FILE% text/plain

After the 3rd step I noticed the content of one of the impacted images (in our case it is $:/boa/img/protw-logo.svg)

$__boa_img_protw-logo.svg.meta
    _canonical_uri: ./images/%2524%253A%252Fboa%252Fimg%252Fprotw-logo.svg
    title
: $:/boa/img/protw-logo.svg
    type
: image/svg+xml

$__boa_img_protw-logo.svg
    undefined

The very this last value undefined then has transferred into the HTML single-file wiki as <pre>undefined</pre>.

Another command render shows the similar result.

It looks like some tiny changes happened in the command rendertiddler/render that from recent times generates unwanted content <pre>undefined</pre>. I purposely checked my old stuff generated much earlier - _canonical_uri tiddlers contain just <pre></pre>.

So, my conclusion:
  1. the issue is out of the scope of my competence, 
  2. help of the TW developers' team is rather needed.
I'm grateful in advance.

Olegh

вівторок, 7 січня 2020 р. 18:02:38 UTC+2 користувач oleghbond написав:

oleghbond

unread,
Jan 7, 2020, 4:01:39 PM1/7/20
to TiddlyWiki
Another cause might be in the version of node.js. I'll check

вівторок, 7 січня 2020 р. 20:21:26 UTC+2 користувач oleghbond написав:
Reply all
Reply to author
Forward
0 new messages