Repository navigation
Conversation
The web export already renders "# IMAGE: path" tags, but the preview pane only showed them as text. The preview now displays the image below the tag line, using the same tag syntax. Relative paths are resolved against the main ink file's folder. Absolute paths and http(s)/file/data URLs are used as-is. If the file can't be found, no image is shown and the tag gets an "Image not found" tooltip.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #119.
The web export already turns
# IMAGE: srcinto an<img>, but the preview pane only shows the tag as text, so writers can't see their images while writing. This makes the preview handle the same tag:# IMAGE: file.png(case-insensitive, samePROPERTY: valueparsing as the web template) shows the image below the tag line. The tag text itself is unchanged and still respects "Hide tags".index.html. Absolute paths andhttp(s)/file/dataURLs are used as-is. In an unsaved project, relative images are skipped.No new dependencies; the web export template is unchanged.
Tested on Linux: same-folder, subfolder and absolute paths, missing file, oversized image, choices, rewind / restart, dark theme, Hide tags, unsaved project.
Screenshots:
Image tag on the first line of a story:
Image reached after a few choices: