Lister-Plugin for Markdown formatted text documents?

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

User avatar
rg_software
Member
Member
Posts: 113
Joined: 2009-08-06, 12:59 UTC
Location: Aizu-Wakamatsu, Japan

Re: Lister-Plugin for Markdown formatted text documents?

Post by *rg_software »

Let's wrap up the comments so I can check what's actually going on:

1) On plugin info. If I download the plugin from Github, I see this info section, which is correct:

Code: Select all

[plugininstall]
description=Markdown viewer based on HTMLView plugin source and Hoedown library.
type=wlx
file=MarkdownView.wlx
defaultdir=plugins\wlx\MarkdownView
So I am not really sure where you see old information about HTMLView.

2) On external dependences. Yes, now there is no need for tools such as Hoedown.exe and Smartypants.exe, I integrated everything into the plugin. So are we talking about certain missing files or broken DLL due to functions possibly missing in WinXP as suggested above?..

Update. Okay, I see that indeed the plugin is probably incompatible with WinXP. I changed the toolset, and this is what I got now. Please try this version and let me know whether it works.
https://www.dropbox.com/s/nh83otkp3pgsqf6/markdownview-2312.zip?dl=1
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Lister-Plugin for Markdown formatted text documents?

Post by *Usher »

rg_software wrote: 2018-12-23, 05:05 UTCSo I am not really sure where you see old information about HTMLView.
In the wlx itself. Right click the wlx file and see its properties. Now look at the HTMLView.rc file and you will see old data in VS_VERSION_INFO resources. When properly managed by IDE, the version may change automatically with every build.
rg_software wrote: 2018-12-23, 05:05 UTCSo are we talking about certain missing files or broken DLL due to functions possibly missing in WinXP as suggested above?..
It's most possible source of the problem. I was just guessing what could be wrong.
rg_software wrote: 2018-12-23, 05:05 UTCPlease try this version and let me know whether it works.
It installs with no warning now, but crashes when pressing F3 to view almost every file, here's the error message:

Code: Select all

Crash in plugin MarkdownView.wlx:ListLoad:
Access violation at address 02D7C095. Read of address 0000000C
The first address may be different for every try, f.e. 02C0C095, 1000C095.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
rg_software
Member
Member
Posts: 113
Joined: 2009-08-06, 12:59 UTC
Location: Aizu-Wakamatsu, Japan

Re: Lister-Plugin for Markdown formatted text documents?

Post by *rg_software »

In the wlx itself. Right click the wlx file and see its properties.
Yeah, noted. I will fix it.
Crash in plugin MarkdownView.wlx:ListLoad:
Weird, to be honest. XP support wasn't really on my list, but I see no reason why it has to fail. I will think about it, but perhaps in practice it means I have to install XP and all the tools to do proper debugging :(
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Lister-Plugin for Markdown formatted text documents?

Post by *Usher »

I think you should either add all *ms-win*.dll stub files listed in wlx or find proper installer of MSVC runtime (MSVC 12/2013 or 14/2015?) which contains those libs:

Code: Select all

api-ms-win-appmodel-runtime-l1-1-1.dll
api-ms-win-core-datetime-l1-1-1.dll
api-ms-win-core-fibers-l1-1-1.dll
api-ms-win-core-file-l2-1-1.dll
api-ms-win-core-localization-l1-2-1.dll
api-ms-win-core-localization-obsolete-l1-2-0.dll
api-ms-win-core-processthreads-l1-1-2.dll
api-ms-win-core-string-l1-1-0.dll
api-ms-win-core-synch-l1-2-0.dll
api-ms-win-core-sysinfo-l1-2-1.dll
api-ms-win-core-winrt-l1-1-0.dll
api-ms-win-core-xstate-l2-1-0.dll
api-ms-win-rtcore-ntuser-window-l1-1-0.dll
api-ms-win-security-systemfunctions-l1-1-0.dll
ext-ms-win-kernel32-package-current-l1-1-0.dll
ext-ms-win-ntuser-dialogbox-l1-1-0.dll
ext-ms-win-ntuser-windowstation-l1-1-0.dll
Most of them are missing in my system, possibly they are newer.
I have files with following versions:
10.0.14393.33 in Firefox directory
10.0.10586.15 in system32 directory
10.0.10586.212 in Poedit directory

All the files are small (about 300 KB in total), so you can easy add them to the package. They may be required also in Windows Vista and Windows 7 so it's the best solution, I think. Alternatively you can use older MSVC compiler…
Andrzej P. Wozniak
Polish subforum moderator
User avatar
rg_software
Member
Member
Posts: 113
Joined: 2009-08-06, 12:59 UTC
Location: Aizu-Wakamatsu, Japan

Re: Lister-Plugin for Markdown formatted text documents?

Post by *rg_software »

While I compile with MSVC 2017, it includes the toolset called "v141_xp" specially for WinXP, so I expected that it should work without any additional efforts. I also used "static build", so in principle the external modules had to be included in the package. Anyway, will try to investigate.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Lister-Plugin for Markdown formatted text documents?

Post by *Dalai »

2Usher
I don't think these DLLs are required for the plugin to work. While you're correct that these DLLs' names can be found in the plugin, they don't appear in the plugin's import table. I remember to have seen these names in DLLs/EXEs of other programs, but they didn't redistribute them either.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Lister-Plugin for Markdown formatted text documents?

Post by *Usher »

2rg_software
2Dalai
As I understand from your explanations, these DLLs are already linked statically into wlx file, that's why we can see their names without .dll extension. I did read the MS docs here:
https://docs.microsoft.com/en-us/cpp/build/configuring-programs-for-windows-xp?view=vs-2017
and I know that v141_xp means MSVC 2017 toolset for Windows XP, so maybe MSVC 2017 runtime is needed. Other software packages (Firefox, Poedit) are distributed with different ms-win libs and VC 14 runtime, so I think that they use v140_xp toolset.

2rg_software
For the start make clean build with v140_xp toolset.
I think, that it may work for text-only view, with no pictures linked, because the docs claim that some additional configuration and/or some additional packages (f.e DirectX SDK) may be needed for graphic support. For example, Firefox does use d3dcompiler_47.dll (Direct3D HLSL Compiler for Redistribution, 10.0.14393.33), Poedit does not (and doesn't work with pictures).
Andrzej P. Wozniak
Polish subforum moderator
User avatar
rg_software
Member
Member
Posts: 113
Joined: 2009-08-06, 12:59 UTC
Location: Aizu-Wakamatsu, Japan

Re: Lister-Plugin for Markdown formatted text documents?

Post by *rg_software »

I don't think it works this way. A redistributable package is necessary when you link dynamically (that's the whole point). Static linking essentially includes everything necessary from the redistributable into the resulting package. Also, when something is missing, it should tell this right away :)

Access violation errors are memory errors and most probably related to something much less obvious. BTW, I presume that the original HTMLView works fine for you, so the problem is indeed in my code.
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Lister-Plugin for Markdown formatted text documents?

Post by *Usher »

Just make clean build with v140_xp toolset, please, forget other guesses for now.
HTMLView worked OK for me maybe a year ago. I will do tests in a few days, just leaving now…
Andrzej P. Wozniak
Polish subforum moderator
User avatar
rg_software
Member
Member
Posts: 113
Joined: 2009-08-06, 12:59 UTC
Location: Aizu-Wakamatsu, Japan

Re: Lister-Plugin for Markdown formatted text documents?

Post by *rg_software »

Well, I don't think it makes any difference, but please try this freshly-built version. I will also prepare a debug version, maybe it will provide more diagnostics.

Maybe procdump will generate some reasonable crash dump. Run it as

Code: Select all

procdump -ma -i c:\dumps
to get crashdumps of all faulty apps.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Lister-Plugin for Markdown formatted text documents?

Post by *petermad »

I just tried the markdown-xp-2512.zip versiom under Windows XP 32bit and get this when I try to open Lister:
---------------------------
error
---------------------------
Crash in plugin MarkdownView.wlx:ListLoad:

Access violation at address 0276C065. Read of address 0000000C
---------------------------
OK Annuller
--------------------------
-
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
rg_software
Member
Member
Posts: 113
Joined: 2009-08-06, 12:59 UTC
Location: Aizu-Wakamatsu, Japan

Re: Lister-Plugin for Markdown formatted text documents?

Post by *rg_software »

Try this version, it should work :)

It seems that WinXP has a certain bug that nobody is going to fix anymore (obviously), but fortunately there are compiler switches that force XP-safe code generation.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Lister-Plugin for Markdown formatted text documents?

Post by *petermad »

2rg_software
The https://www.dropbox.com/s/u7wjgkix1nf72s1/markdownviewer-2612.zip?dl=1 version now doesn't cause eny errors under Windows XP.

Could you provide a sample .md file I could test it with?
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
rg_software
Member
Member
Posts: 113
Joined: 2009-08-06, 12:59 UTC
Location: Aizu-Wakamatsu, Japan

Re: Lister-Plugin for Markdown formatted text documents?

Post by *rg_software »

User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Lister-Plugin for Markdown formatted text documents?

Post by *Usher »

rg_software wrote: 2018-12-25, 19:28 UTCTry this version, it should work :)
Works with no error messages now. Here's readme.md using even more features (go to the linked webpage, right click "Raw" button and select "Save target as…", "Download" or similar option from the context menu to get local copy):
https://github.com/harbour/core/blob/master/README.md

You can see that there are bugs in the plugin as it doesn't properly work with markdown links:
  • Internal links are not properly converted to HTML anchor links f.e. from the table of content. Currently the plugin generates absolute links composed of path to the file (without is name) and anchor f.e. file:///c:/test/#chapter-1 but it should be just anchors linked as relative paths, I think.
    In the HTML code it's now <a href="file:///c:/test/#chapter-1"> and it should be just <a href="#chapter-1">
  • Relative links to local files are also converted to absolute ones and the viewer doesn't follow them, even if the files are copied to the right paths. For example I did click link to LICENCE.txt with no results, though the file had been copied earlier. The plugin will probably work OK with relative links like <a href="LICENSE.txt">.
  • The plugin does follow the absolute web URLs (http/https) but For markdown view it would be better to open external links in default browser (like Lister does) rather than in this IE-powered html-only (no JS, no CSS) view. Many HTTPS sites are unavailable in IE under Windows XP/Vista as those systems don't provide full support for TLS 1.1+.
  • The buttons on the top don't function properly, they don't even have description when hovered with mouse. For example you cannot go backward to the README.md, Backspace key doesn't work, too.
There are some more missing/buggy features. I don't know if you are already familiar enough with the plugin code to fix it quickly so I don't get into deeper tests for now.

rg_software wrote: 2018-12-25, 19:28 UTCIt seems that WinXP has a certain bug that nobody is going to fix anymore (obviously), but fortunately there are compiler switches that force XP-safe code generation.
Could you explain it more detaily, please?
What bug do you mean?
What toolset/compiler have you used and what compiler switches have you changed/added?

Oh, an I did retest HTMLView and it works OK. But it is expected result, as its last version 1.2.6 is dated on 2011 and it couldn't be compiled with any newer compiler than MSVC 2011.
Andrzej P. Wozniak
Polish subforum moderator
Post Reply