NppMarkdownPanel icon indicating copy to clipboard operation
NppMarkdownPanel copied to clipboard

Is it possible to add the ability to open a web page inside Notepad++ and navigate forward and backward?

Open zhouxinghong opened this issue 4 months ago • 7 comments

Dear friend!

Would you consider adding the ability to open web pages within Notepad++ and navigate forward and backward?

I think this feature is extremely important. If it were possible, clicking on links would no longer require jumping to an external browser, saving me the hassle of switching back and forth between windows.

Tip: This feature is already integrated into WebView2 by default.

zhouxinghong avatar Aug 10 '25 13:08 zhouxinghong

@zhouxinghong, @mohzy83

Yes, it's easy enough. For example see how it's been implemented in the Preview HTML plugin (as of v1.4.0.0 — not released yet).

preview html v1.4-pre demo

rdipardo avatar Aug 10 '25 19:08 rdipardo

@zhouxinghong

Also, does the right-click menu on a Markdown preview also support forward and backward navigation?

Yes, they are all supported.

Is it possible to directly support Markdown preview?

Yes, by way of a custom filter. It is not properly documented, but have a look at https://github.com/rdipardo/npp_preview/blob/master/src/config/filters.sample.ini

For example, you can use this configuration to transform MarkDown with pandoc:

; %AppData%\Notepad++\plugins\Config\PreviewHTML\Filters.ini

[markdown]
Extension=.md,.mkd,.markdown
Command=pandoc -t html -f gfm "%1" --ascii=true --strip-comments=true --sandbox=true

rdipardo avatar Aug 11 '25 18:08 rdipardo

@zhouxinghong

Unable to preview .md files directly

The screenshot makes me think it could not detect a Markdown filter.

Things to try:

  • Click on Plugins > Preview HTML > Edit filter definitions

    What file does it open? Your custom config, or the default sample?

    For portable Notepad++, the config file path should be $(PORTABLE_NPP_DIR)\plugins\Config\PreviewHTML\Filters.ini

    For full installations, it should be %APPDATA%\Notepad++\plugins\Config\PreviewHTML\Filters.ini

  • Is the pandoc.exe in the system's %PATH% ?

You may need to copy the program's full path into the config, e.g.,

[markdown]
; ...
Command="C:\Users\Rob\scoop\apps\pandoc\3.7.0.2\pandoc.exe" ....

Note: you have 1.3.3.3 installed, which uses IExplorer, not WebView2.

rdipardo avatar Aug 13 '25 18:08 rdipardo

@zhouxinghong

Improved interaction logic ...

Make a feature request and I will include it in the next WebView2 version.

rdipardo avatar Aug 13 '25 18:08 rdipardo

What file does it open? Your custom config, or the default sample?

Open .md, which is the default configuration.

For portable Notepad++, the config file path should be $(PORTABLE_NPP_DIR)\plugins\Config\PreviewHTML\Filters.ini

Yes

Is the pandoc.exe in the system's %PATH% ?

Yes

pandoc --version
pandoc.exe 3.7.0.2
Features: +server +lua
Scripting engine: Lua 5.4

zhouxinghong avatar Aug 13 '25 18:08 zhouxinghong

An error occurred when launching Notepad++ after installing PreviewHTML_v1.4.0.0_x64.zip. Image

This is because multiple versions of the Edge browser are installed on the system.

1.0.3296.44 is the version of WebView2Loader.dll distributed with MarkdownPanel: $(NPP_INSTALL_DIR)\NppMarkdownPanel\lib\runtimes\win-x64\native\WebView2Loader.dll

1.0.3351.48 is the version distributed with Preview HTML.

If you have both MarkdownPanel and a WebView version of Preview HTML installed, you will have to remove one of them. I don't think running both at the same time can ever be a supported scenario...

rdipardo avatar Aug 14 '25 21:08 rdipardo

Although the program no longer reports errors when it starts, it is still unable to preview Markdown files directly.

Please look at the new wiki page. A future version will provide a button linking to it.

rdipardo avatar Aug 15 '25 19:08 rdipardo