A polymer (1.0) element - Markdown editor for commonmark inspired by the commonmark dingus app.
See Online demo (thanks marcus7777)

bower install commonmark-editor
<commonmark-editor height="500px">
Some initial markdown content (optional)
</commonmark-editor>
heightdefault ="400px"placeholderdefault ="Markdown content"changedByUserturn to true if value changed by client keypressworking-dir: every image url which contain only image name will concatenate with the working-dir value if it is set. Example ifworking-dir = "/content"thenwill be replaced bywill be replaced bywon't changedwon't changedwon't changed
npm install
bower install
To run demo on localhost, you have to use polyserve
npm install -g polyserve
polyserve
then navigate to
http://localhost:8082/components/commonmark-editor/demo- or
http://localhost:8082/components/commonmark-editor/test
There is features/enhancements which I did NOT implement because they are not required for my production project. I might come back to implement them later... Here is the priority list
- Enhance preview highlighting
- There is some place on the source it should know where to highlight in the preview result, but it is not the case.
- Sync scrolling between source and preview
- Make scroll animation
- Make
working-dirwork with every relative local path- For now, it work only with image path which contains only the image name
- Reponsiveness - checkout this branch...
- Theming capable