Open TheodoreChu opened 4 years ago
It doesn't look like we're handling preview generation (related to EditorKit, not markdown editor): https://github.com/standardnotes/editor-kit/blob/master/src/lib/EditorKitInternal.js#L212
https://github.com/sn-extensions/markdown-basic/blob/master/app/components/Home.js#L163
Previews related to what is shown in the two lines under the note title in the list of notes. Here we want to escape markdown syntax. This is why we render the content even if they are just in edit mode.
For example, if the user types "# hello" in the first line of the note, the preview in the list of notes in the SN interface should just say "hello".
I think the result of preview generation has to do with EditorKit, not the optimization that I tried to implement earlier
Custom previews should work with the latest commit: https://github.com/sn-extensions/markdown-basic/pull/29/commits/5be724055c9b0acce041b788788c6e4067336911
I changed the favicon to a blue hashtag that I found on Figma and I added Prettier. Is that OK?
When the PR is ready, feel free to delete Home.js
When the PR is ready, feel free to delete Home.js
Wait what? You should delete this file as part of your PR if that's what constitutes a wholly complete code refactor.
When the PR is ready, feel free to delete Home.js
Wait what? You should delete this file as part of your PR if that's what constitutes a wholly complete code refactor.
I thought you might have wanted to do the honors of deleting Home.js
. I deleted it: https://github.com/sn-extensions/markdown-basic/pull/29/commits/3c26a0887e7d4a1e3ab44eaf0784ccf7bfd1d665
@ningsongshen can you review this PR and test locally in SN env? Especially see if previews are being generated correctly (as in the 2-line preview that appears in SN under the note's title)
So I've just tested it (will look at the PR code a bit later), here are my comments:
null
in it.I can only see one line of preview, whether it is on web or desktop or Windows or Linux
I think that's expected.
If there is nothing in the editor, the preview has
null
in it.
@TheodoreChu
EDIT: nevermind it is an error on my end. Note to self: use http not https
This didn't happen when I last tested it but now I can't seem to import the extension :cry:
So Theodore requested some assistance finish up this PR but it's pretty big so I wanted to split it up into smaller parts that I can test and try it out to understand the changes (and for whoever is coming to work on this after me!)
Changes:
watch
andserver
commands.js
to.tsx
tsconfig.json
webpack.config.js
Fix line-height in textarea to match rendered text (1.5em). Addresses https://github.com/sn-extensions/markdown-basic/issues/3var
's tolet
andconst
this
fordocument.getElementById
<div>
buttons to<buttons>
React
andReact-dom
are loaded separately, improving performanceREADME.md