Comments (3)
For our internal use cases we don't need to support embedded base64 images. The default behavior of the editor consider data urls (e.g. data:image/png;base64,<base64>
) invalid links. To change that behavior you can pass your own link validator:
https://github.com/StackExchange/Stacks-Editor/blob/main/src/shared/view.ts#L99
Passing the following stacks editor configuration will make all text a valid link (including data urls). This will instruct the editor to parse embed images as you expect to.
{
parserFeatures: {
validateLink: () => true
}
}
from stacks-editor.
Thanks for raising this issue.
The problem you are describing is related to how the image upload handler has been setup in the editor playground.
https://github.com/StackExchange/Stacks-Editor/blob/main/site/index.ts#L92
In the playground we don't upload images in any 3rd party services and instead we have a couple of dummy solutions which allow us to keep the image in browser memory.
The first solution is using a service worker that intercept requests to a specific domain and store/serve images. This solution is currently working locally but not in the deployed playground (we will look into why that's the case).
The other workaround is reading and translating an image to a data url (which is what's happening in the playground).
As I said those solutions are dummy examples, most times you want to setup your image upload handler so that it pushes the files to an hosting solution (not store them in the user browser).
Here is the interface for the image upload plugin options interface:
https://github.com/StackExchange/Stacks-Editor/blob/main/src/shared/prosemirror-plugins/image-upload.ts#L31
I am going to close this issue since it is not really a problem with the editor itself but rather with the way the image upload handler is setup in the playground.
from stacks-editor.
Hello @giamir, I am afraid you misunderstand my issue. In my particular use case, I do not want to upload the image to a hosting solution. In stead, I want the image to be embedded into the markdown content as BASE64 encoded. So far this works as expected, and if I convert the markdown content to HTML with this embedded BASE64 content, the generated HTML works, too.
The problem here is that Stacks Editor does not render the image from embedded BASE64 content, if the markdown with such embedded images is loaded into the editor.
from stacks-editor.
Related Issues (20)
- Double the expected thumbnails showing on image pasting HOT 2
- Code block within spoiler gives different result than shown in preview HOT 2
- v0.8 remove default renderer, Could you some one give me a sample with mathjax3 HOT 1
- docx4J with grails groovy. Good evening team, I have a problem. when I want to recover my content controls from my docx file it corrupts my output file. I really need help. Thanks in advance HOT 1
- Add the ability to remove references to Meta tags in the menu bar
- Support non-focusable disabled state.
- Cannot use a `|` character in table header
- bug(markdown) Code blocks surrounded by single backtick then triple backticks
- Inline code marks allow other marks applied to their content
- bug (markdown with preview) [meta-tag:tag-name] is rendered as plaintext in preview HOT 2
- Escaping '#' inside bullet lists doesn't round-trip
- Don't apply formatting in the raw Markdown editor when Markdown preview is enabled HOT 6
- Css isolation help angular HOT 1
- Markdown Mode: Support using Shift + Enter to add newline
- Reporting a vulnerability
- Editor menu dropdowns are missing a11y role attributes HOT 1
- Math formulas support HOT 1
- Distribution code is missing from repo HOT 2
- Task list support 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 stacks-editor.