Comments (7)
This can be inserted in MarkdownPreviewForm.cs
in line 128 (desperate solution).
(I have created pull request).
//using System.Text.RegularExpressions;
//string inp = " * %25%20x : `<img src=\"file:///C:/tmp/test%20nonAscii%20path/A%C4%85C%C4%87E/A%C4%84%2520(2).png\" />`";
//outp: * %25%20x : `<img src="file:///C:/tmp/test nonAscii path/AąCćE/AĄ%20(2).png" />`
Regex regex = new Regex("src=\"file:///[^\"]+");
resultForBrowser = regex.Replace(resultForBrowser, m => Uri.UnescapeDataString(m.Value));
from nppmarkdownpanel.
UPD.
Not only a space character, but other chars too (which should be encoded).
For example, if I have [image] example 1—1.png
then I should include it as %5Bimage%5D%20example%201%E2%80%941.png
.
from nppmarkdownpanel.
This is a bug under IE/Edge with local file links containing non US-ASCII chars, with escape chars in URL with %..
Can this be inserted in MarkdownPreviewForm.cs
in line 128?
//Unescape local file links containing non US - ASCII chars because of IE/Edge bug
//But unescape all is probably too much...
resultForBrowser = Uri.UnescapeDataString(resultForBrowser);
Tests in Zip:
test nonAscii path.zip
from nppmarkdownpanel.
public static MarkdownPipelineBuilder UseNonAsciiNoEscape(this MarkdownPipelineBuilder pipeline);
// Uses this extension to disable URI escape with % characters for non-US-ASCII
// characters in order to workaround a bug under IE/Edge with local file links containing
// non US-ASCII chars. DO NOT USE OTHERWISE.
but inserting it in MarkdigMarkdownGenerator.cs
doesn't work:
public string ConvertToHtml(string markDownText, string filepath)
{
...
var pipeline = new MarkdownPipelineBuilder()
.UseNonAsciiNoEscape()
from nppmarkdownpanel.
This is a bug under IE/Edge with local file links containing non US-ASCII chars, with escape chars in URL with
%..
Can this be inserted in
MarkdownPreviewForm.cs
in line 128?//Unescape local file links containing non US - ASCII chars because of IE/Edge bug //But unescape all is probably too much... resultForBrowser = Uri.UnescapeDataString(resultForBrowser);
I think its no good idea to unescape the complete document. This can lead to undesired side effects.
It would be better to unescape only src attribute of img tags.
from nppmarkdownpanel.
public static MarkdownPipelineBuilder UseNonAsciiNoEscape(this MarkdownPipelineBuilder pipeline); // Uses this extension to disable URI escape with % characters for non-US-ASCII // characters in order to workaround a bug under IE/Edge with local file links containing // non US-ASCII chars. DO NOT USE OTHERWISE.but inserting it in
MarkdigMarkdownGenerator.cs
doesn't work:public string ConvertToHtml(string markDownText, string filepath) { ... var pipeline = new MarkdownPipelineBuilder() .UseNonAsciiNoEscape()
Doesn't work for me neither.
Actually this setting should produce the desired result.
from nppmarkdownpanel.
fixed in release 0.7.2
from nppmarkdownpanel.
Related Issues (20)
- [Feature Request] Is it possible to add Markdeep to the viewer? HOT 3
- [Future request] The MarkdownViewer++ does not render the latex equation HOT 2
- [Feature Request] Pandoc post-processing via Save As... HOT 1
- Table of Contents (TOC) option HOT 1
- Local relative path not working with img tag HOT 2
- Error on execution in Markdown Panel. HOT 1
- Feature Request: Links whitin the same document HOT 2
- Auto update Markdownviewer preview panel not working anymore HOT 4
- Dark-mode .css anchor color is ignored when rendered in Notepad++ but displayed correctly in exported HTML
- Unable to display special characters HOT 4
- `NppTbData.pszModuleName` is not properly assigned when Markdown panel is docked
- The keyboard shortcuts are not working on the Markdown Panel. HOT 1
- Deprecated...
- Deprecated...
- Proposal - ID as combination of tag name and id number HOT 1
- Local images preview has dont work HOT 1
- preview scroll position is not preserved when switching to another file then back to markdown file
- Undocking the viewer from its default position crashes NotePad++
- Always render fenced code blocks (solved) HOT 3
- Limiting to particular file extensions is too limiting HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nppmarkdownpanel.