Comments (4)
Seems to work for me. Can you create a repo that will reproduce this?
import { marked } from "marked";
const walkTokens = (token) => {
if (token.type === 'image') {
token.href = "blob:http://mysite/75647557-f25e-43ab-bd42-02263748f3ed" // provided this blob exists
}
};
marked.use({walkTokens});
marked.parse("![image](http://image)");
<p><img src="blob:http://mysite/75647557-f25e-43ab-bd42-02263748f3ed" alt="image"></p>
from marked.
I'm still experiencing this issue within our app where the marked instantiation is isolated from everything else, but I will plan to recreate in a separate repo when I get a few moments.
from marked.
It sounds to me like you have some sanitization going on. Marked returns the img with blob in src then your sanitizer removes the src attribute.
from marked.
That's exactly what happened. Thanks for helping me figure it out!
from marked.
Related Issues (20)
- Handle [!NOTE] HOT 1
- v11.0.0. yields "Uncaught Error: renderer 'options' does not exist" in code that worked in versions up to v10.0.0 HOT 3
- Task List, Unordered List and Blockquote Bugs, along with Suggestions for Improvement HOT 2
- Proposal: mark-down html element HOT 1
- Marked treats tabs and spaces differently in lists
- Error: renderer 'options' does not exist HOT 1
- MiniProgramError SyntaxError: Invalid regular expression: /[\p{L}\p{N}]/: Invalid property name in character class HOT 1
- Rendering not as expected when using custom elements HOT 1
- Parsed syntax tree cannot be modified (note: will not be implemented) HOT 25
- Invalid regular expression in lower chrome HOT 1
- Multiple list with sublist - <p> tag inserts seems not quite right HOT 1
- marked parse mathematical formula error HOT 14
- Images? ![]() HOT 3
- Escape sequences in links are not unescaped HOT 1
- Lexer handling newlines incorrectly in some cases HOT 1
- Incompatibility with esNext Syntax in marked.js Bundle HOT 6
- Register Walktokens Behavior for extensions with different token structure HOT 4
- Clarify ambiguity around "extensions" HOT 1
- Marked Extensions Versioning HOT 7
- Issues with Parsing Nested Emphasis and Handling Chinese Parentheses 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 marked.