All Projects → OpusCapita → React Markdown

OpusCapita / React Markdown

Licence: apache-2.0
Markdown editor (input) based on React

Programming Languages

javascript
184084 projects - #8 most used programming language
js
455 projects

Projects that are alternatives of or similar to React Markdown

React Markdown Editor Lite
a light-weight Markdown editor based on React. 一款轻量的基于React的markdown编辑器
Stars: ✭ 553 (+464.29%)
Mutual labels:  markdown, editor, component
For Editor
for-editor - A markdown editor based on React
Stars: ✭ 358 (+265.31%)
Mutual labels:  markdown, editor, component
O
🌀 Text editor suitable for writing git commit messages and editing Markdown files. Can build executables and jump to errors at the press of `ctrl-space`, for several programming languages. Can format code with `ctrl-w`. Provides general syntax highlighting, rainbow parenthesis and cut/paste portals. o is intentionally limited to VT100.
Stars: ✭ 54 (-44.9%)
Mutual labels:  markdown, editor
Pesdk React Native Demo
React Native example for PhotoEditor SDK
Stars: ✭ 57 (-41.84%)
Mutual labels:  library, editor
Markdown Builder
1kb Markdown builder for Node.js
Stars: ✭ 67 (-31.63%)
Mutual labels:  markdown, library
Thiefmd
The markdown editor worth stealing. Inspired by Ulysses, based on code from Quilter
Stars: ✭ 48 (-51.02%)
Mutual labels:  markdown, editor
Faboptions
A multi-functional FAB component with customizable options
Stars: ✭ 1,060 (+981.63%)
Mutual labels:  library, component
React Native Markdown Editor
A markdown editor like github comment editor (contains preview, helper buttons)
Stars: ✭ 59 (-39.8%)
Mutual labels:  markdown, editor
Manuskript
A open-source tool for writers
Stars: ✭ 960 (+879.59%)
Mutual labels:  markdown, editor
React Mde
📝 React Markdown Editor
Stars: ✭ 1,196 (+1120.41%)
Mutual labels:  markdown, component
Markdownxiaoshujiang
markdownxiaoshujiang
Stars: ✭ 1,188 (+1112.24%)
Mutual labels:  markdown, editor
Wymaterialbutton
Interactive and fully animated Material Design button for iOS developers.
Stars: ✭ 80 (-18.37%)
Mutual labels:  library, component
Pannellum React
React Component for Pannellum (open source panorama viewer for the web)
Stars: ✭ 48 (-51.02%)
Mutual labels:  library, component
Blink Mind React
A mind map library for react that based on immutable.js.
Stars: ✭ 38 (-61.22%)
Mutual labels:  markdown, library
Canner Slate Editor
📝Rich Text / WYSIWYG Editor built for Modularity and Extensibility.
Stars: ✭ 1,071 (+992.86%)
Mutual labels:  markdown, editor
Hellobooks
A Single-Page Library Management App built with nodejs, express and react and redux
Stars: ✭ 37 (-62.24%)
Mutual labels:  library, component
Vnote
A pleasant note-taking platform.
Stars: ✭ 8,714 (+8791.84%)
Mutual labels:  markdown, editor
Ngx Select Dropdown
Custom Dropdown for Angular 4+ with multiple and single selection options
Stars: ✭ 91 (-7.14%)
Mutual labels:  library, component
Vuep
🎡 A component for rendering Vue components with live editor and preview.
Stars: ✭ 840 (+757.14%)
Mutual labels:  editor, component
Egjs
Javascript components group that brings easiest and fastest way to build a web application in your way.
Stars: ✭ 871 (+788.78%)
Mutual labels:  library, component

React Markdown

CircleCI Status badge-npm-version badge-license NPM Downloads

demo

Built using slate-js

Usage

Install npm package:

npm install -E @opuscapita/react-markdown

Import it to your application

import MarkdownInput from '@opuscapita/react-markdown

See interactive example for more details: https://opuscapita.github.io/react-markdown

Demo powered by React Showroom

If you want to use together with Bootstrap Modal, you need to add styles:

.markdown-input_fullscreen { // pass this class to Modal component
  overflow: hidden;
}
.markdown-input_fullscreen.modal.in .modal-dialog {
  transform: none;
}

How it works

MarkdownEditor supports the following decorators:

  • bold
  • italic
  • strikethrough
  • heading-1
  • heading-2
  • heading-3
  • heading-4
  • heading-5
  • heading-6
  • list
  • ordered-list

Buttons (their groups, sequence)

[B, I, S] [A] [H1, H2, H3, H4, H5, H6], [UL, OL]

  • inline text actions
    • [B] - bold mark
    • [I] - italic mark
    • [S] - strikethrough mark
  • link
    • [A] - anchor insert
  • text block actions
    • [H1] - header 1 block
    • [H2] - header 2 block
    • [H3] - header 3 block
    • [H4] - header 4 block
    • [H5] - header 5 block
    • [H6] - header 6 block
  • lists
    • [UL] - list block
    • [OL] - ordered list block

Note for multi-line selection: only list and ordered list are available for multi-line selection, other buttons in a toolbar are disabled, because otherwise markdown highlighting becomes inconsistent.

Behaviour

Block elements

List [UL] button

Here is specification by video example for this button

list-button-optimized

  • Insert marker '* ' at the beginning of the line if line does not start with ['{number}. ', '# ', '## ', '### ', '#### ', '##### ', '###### ']
  • Replace with marker '* ' if line starts with ['{number}. ', '# ', '## ', '### ', '#### ', '##### ', '###### ']
  • Insert marker '* ' at the beginning of the next line if enter is pressed at the end of the line that is marked as list item if item contain any text
  • Clear line from '* ' and put cursor to a new line if user pressed enter at the end of the line that marked as list item but does not contain any text
Ordered list [OL] button

Here is specification by video example for this button

ordered-list-button-optimized

  • Insert marker '1. ' at start of the line if it does not start with ['* ', '# ', '## ', '### ', '#### ', '##### ', '###### ']
  • Replace with marker '1. ' if line starts with ['* ', '# ', '## ', '### ', '#### ', '##### ', '###### ']
  • Insert marker '{number+1} ' at the beginning of in the next line if enter is pressed at the end of the line that is marked as list item if item contains any text
  • Clear line from '{number} ' and put cursor to a new line if user pressed enter at the end of the line that is marked as ordered list item but does not contain any text
Header item [h1-h6] buttons

Here is specification by video example for [H2] button (other header buttons work correspondingly)

h2-button-optimized

  • Insert marker '# ' - '###### ' (in depends on button) at start of the line if it does not start with ['* ', '{number}. ']
  • Replace with marker '# ' - '###### ' (in depends on button) if line stars with ['* ', '{number}. ']
  • Remove existing header marker if corresponding header button is clicked
  • Update existing header marker to another header marker one if current header marker does not correspond to pressed header button

Marked elements

Here is specification by video example for these buttons

bold-italic-strikethrough-optimized

Bold [B] button
  • Selected text is wrapped with '**', e.g. {selected_text} -> **{selected_text}**
  • If selected text contains bold text then it is unwrapped, for example **{selected_text}** -> {selected_text}
  • Inserts '**{cursor}**' into cursor position if text is not selected, and cursor is placed inside
Italic [I] button
  • Selected text is wrapped with '_', e.g. {selected_text} -> _{selected_text}_
  • If selected text is marked as italic then it is unwrapped, for example _{selected_text}_ -> {selected_text}
  • Inserts '_{cursor}_' into cursor position if text is not selected, and cursor is placed inside
Strikethrough [S] button
  • Selected text is wrapped with '~~', e.g. {selected_text} -> ~~{selected_text}~~
  • If selected text is marked as strikethrough then it is unwrapped, for example ~~{selected_text}~~ -> {selected_text}
  • Inserts '~~{cursor}~~' into cursor position if text is not selected, and cursor is placed inside

Inline elements

External anchor [A] button

Here is specification by video example for this button

link-button-optimized

Known issues

  • In case of multi line selection toolbar all buttons except list and ordered list are not available (no action is supported)
  • Code blocks are not supported

Contributors

Alexey Sergeev
Dmitry Divin
Dmitry Sanko
Aleksandr Baliunov
Kirill Volkovich

License

Licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].