Is it possible to add the ability to open a web page inside Notepad++ and navigate forward and backward?
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, @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).
@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
@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 definitionsWhat 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.iniFor full installations, it should be
%APPDATA%\Notepad++\plugins\Config\PreviewHTML\Filters.ini -
Is the
pandoc.exein 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.
@zhouxinghong
Improved interaction logic ...
Make a feature request and I will include it in the next WebView2 version.
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
An error occurred when launching Notepad++ after installing PreviewHTML_v1.4.0.0_x64.zip.
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...
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.
