GithubHelp home page GithubHelp logo

stackexchange / stacks-editor Goto Github PK

View Code? Open in Web Editor NEW
326.0 17.0 49.0 6.37 MB

Stack Overflow's Combination Rich Text / Markdown Editor

Home Page: https://editor.stackoverflow.design

License: MIT License

JavaScript 0.92% HTML 1.62% TypeScript 96.20% Shell 0.02% CSS 1.24%

stacks-editor's Introduction

Stacks-Editor

Stacks-Editor is a combination rich text / markdown editor that powers Stack Overflow's post editing experience.

Usage

Installation

npm install @stackoverflow/stacks-editor

Import via Modules or CommonJS

<div id="editor-container"></div>
import { StacksEditor } from "@stackoverflow/stacks-editor";
// don't forget to include the styles as well
import "@stackoverflow/stacks-editor/dist/styles.css";
// include the Stacks js and css as they're not included in the bundle
import "@stackoverflow/stacks";
import "@stackoverflow/stacks/dist/css/stacks.css";

new StacksEditor(
    document.querySelector("#editor-container"),
    "*Your* **markdown** here"
);

Import via <script> tag

<!--include Stacks -->
<link rel="stylesheet" href="path/to/node_modules/@stackoverflow/stacks/dist/css/stacks.css" />
<!-- include the bundled styles -->
<link
    rel="stylesheet"
    href="path/to/node_modules/@stackoverflow/stacks-editor/dist/styles.css"
/>

<div id="editor-container"></div>

<!-- highlight.js is not included in the bundle, so include it as well if you want it -->
<script src="//unpkg.com/@highlightjs/cdn-assets@latest/highlight.min.js"></script>
<!--include Stacks -->
<script src="path/to/node_modules/@stackoverflow/stacks/dist/js/stacks.min.js"></script>
<!-- include the bundle -->
<script src="path/to/node_modules/@stackoverflow/stacks-editor/dist/app.bundle.js"></script>

<!-- initialize the editor -->
<script>
    new window.stacksEditor.StacksEditor(
        document.querySelector("#editor-container"),
        "*Your* **markdown** here",
        {}
    );
</script>

Development

  1. Install dependencies with npm i
  2. Build and start using npm start
  3. Point your browser to the address listed in the output - typically http://localhost:8080/

Run Tests

Run all unit tests (no end-to-end tests) using

npm run test:unit

Run all end-to-end tests (written in Playwright) using

npm run test:e2e

End-to-end tests need to follow the convention of using someName.e2e.test.ts as their filename. They'll automatically get picked up by the test runner this way.

Browser Bundle analysis

Generate a stats.json file for analysis using

npm run build:stats

You can upload your stats.json file here or here for visualization. See more resources here.

Creating a new release

First, bump the package version and push the commit + tags:

> npm run release
> git push --follow-tags

Next, publish the package (this will run the build step before publishing):

> npm publish

Afterwards, create a GitHub release with the new content from CHANGELOG.md.

stacks-editor's People

Contributors

aalear avatar aaronshekey avatar alienprox avatar b-kelly avatar balpha avatar dancormier avatar dependabot[bot] avatar double-beep avatar giamir avatar hamvocke avatar kristinalustig avatar kylemit avatar mxschmitt avatar nehalpatel avatar stevenkuhn avatar tmcentee avatar wouterdekort avatar yellis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stacks-editor's Issues

Rich text editor can generate potentially invalid commonmark

Reported on Meta.SE

Describe the bug

Overlapping bold/italic formatting leads to incorrect formatting when toggling to Markdown mode.

  1. In rich text mode, write some text.
    • this is bold, now italic, and now?!
  2. Select part of the text.
  3. Make the selection italic.
    • this is bold, now italic, and now?!
  4. Select some overlapping text.
  5. Make the selection bold.
    • this is bold, now italic, and now?!

(Now bold and italic formatting is correctly applied to overlapping portions of the text.)

When switching to Markdown, the formatting is screwed up because Markdown doesn’t support overlapping formatting in this way: adjacent */** is ambiguous at the best of times, but Markdown wouldn’t support this even when using _ to format italics.

Here’s what the editor generates:

**this is bold, *now italic****, and now?!*

… but as mentioned, even the following isn’t really supported by Markdown as far as I’m aware (it certainly isn’t on this site):

**this is bold, _now italic**, and now?!_

Toggle heading shortcut broken in rich text mode

Reported on Meta.SE

Describe the bug

Pressing Ctrl+H does not toggle Heading in Rich Text mode

  • In the old editor, it would cycle between several Headings.
  • In the Markdown mode of the new editor, it toggles between Heading1 and no heading.
  • However, in the Rich Text editor, it only works one way. Pressing Ctrl+H for a second time opens the browser's history tab in Chrome.

Enhanced table toolbar

Reported on Meta.SE.

Describe the solution you'd like

Tables - this button will create a default three-row, two-column table and have special menu options when in rich text mode that allows adding/removing rows and columns.

It would be nice to have some way to specify the number of rows/columns at the creation of the table (and not after), e.g. from Google Document:

Cannot paste into an inline code element

Reported on Meta.SE

Describe the bug

  1. Start typing.

  2. Copy some text (from anywhere) to your clipboard

  3. Use the Ctrl-K shortcut to start a new inline code block or just click the button

  4. (Optional) start typing in your inline code block (the bug happens either way)

  5. Paste your text (Ctrl-V)

Expected: The text will be pasted into the inline code block, and the cursor will be at the end of the text

Currently: The text is pasted as plain text. If there had been text in the inline block, the block closes and the text appears after it. If there hadn’t been text in the inline block, the block vanishes, never to be seen again (if you toggle to markdown mode, there is no evidence of the block.

The same also happens if you select any text within the inline code block and then paste - if you have three words in the block, and select the middle one, then paste, it will split the inline code block into two (first and third words) and then add your pasted text as plain text between the two inline code blocks.

Right click is being treated as a left click in double/triple click situations

Reported on Meta.SE here and here

Describe the bug

After double-clicking a word to highlight it, if you quickly right-click the highlighted word to bring up the context menu, the rest of the paragraph will be highlighted, which should not be the case.

Normal behavior: (Note no new text is highlighted when context menu opens)

Normal text highlighting behavior

New behavior: (Entire paragraph is highlighted before menu opens)

New, broken text highlighting on context menu open

Repro steps:

  1. Double-click word in a paragraph
  2. Immediately right-click highlighted word

Align heading support with Stack Exchange

Reported on Meta.SE.

Is your feature request related to a problem? Please describe.

This markdown:

# one heading

## two heading

### three heading

#### four heading

##### five heading

###### six heading

renders this preview in the rich editor:

It gets posted like such:

Describe the solution you'd like

Fix the rendering in the editor such that h4-h6 are not shown as headings (or add h4-h6 support to SE, but that's out of scope here).

Ctrl+clicking a hyperlink should open the link

Is your feature request related to a problem? Please describe.

Many editors allow opening links with ctrl+click, since clicking the link itself should place the cursor within in. We should support this as well. Currently, ctrl+click doesn't do anything in particular, other than the usual click behavior.

Ensure that custom nodes are serialized/deserialized to/from html properly

Umbrella bug report to track general node serialize/deserialize issues. Serialize is important for copying nodes to the clipboard in a way that we can deserialize on a later paste event. Ideally, custom nodes should serialize as closely to their final rendered versions as possible so that the deserialize can handle both "copied from rich text mode" and "copied from a final rendered post".

Reported on Meta.SE in the following posts:

Add input rule for spoilers

Reported on Meta.SE

Is your feature request related to a problem? Please describe.

Blockquotes are rendered automatically in rich-text mode, but spoilers aren't.

spoiler not rendered automatically in rich-text mode

Add setting to disallow embedding uploaded images

Is your feature request related to a problem? Please describe.

Currently, when an image is uploaded, it is always embedded as an image. There needs to be a setting to force uploaded images to be embedded as links instead.

Additional context

The Stack Exchange network requires this feature, as users with too low of a reputation are disallowed from embedding images.

Pasting content from external editors contains invisible newline characters

Reported on Meta.SE

Describe the bug

Copying quoted text from Markdown mode into a text editor like Visual Studio Code and back invisibly breaks the Markdown to insert extra line breaks between the lines of the quote. Toggling back and forth between rich text and Markdown reveals the extra line breaks.

Copy-pasting between windows inserting linebreaks

To Reproduce

  1. Type the following in markdown mode:
> quote a
> 
> quote b
  1. Toggle to rich text mode and observe it is a single blockquote.
  2. Paste the content in an external editor
    • reproduced with both VS Code and Notepad++
  3. Copy and paste that content back into markdown mode
  4. Toggle to rich text mode and observe each line is a separate block quote

Add string internationalization support

Is your feature request related to a problem? Please describe.

Strings are hard coded in English

Describe the solution you'd like

We need the ability to pass in values for strings for internationalization purposes.

Add ability to paste a link to an external image

Requested on Meta.SE

Is your feature request related to a problem? Please describe.

Clicking the "Insert image" button opens up the following:

Image of the image insertion tool

Which used to feature the ability to click the "paste" link to quickly paste an image or link. Here's how it looked in the older editor's tool:

Image of the older image insertion tool

And once you clicked "paste," you were greeted with a user-friendly textbox:

Image of the older image insertion tool, expanded

I take a lot of screenshots using third-party snipping tools (which auto-upload them to various image hosting sites, copying the link to my clipboard in the process), and I liked quickly uploading them using the "paste" link in the older tool, as it very quickly uploads them to Stack Exchange's imgur hosting service. Now, the only option available to me is to open a file dialog. I can paste the link directly into the "File name" portion of the open file dialog, but the ability to quickly paste a link without being taken to another window was far more streamlined.

Could you reinstate the ability to paste a link in the image insertion pane?

Add rich text insert equivalents of all markdown-only nodes

Related report on Meta.SE

Is your feature request related to a problem? Please describe.

There is no way to create many custom markdown-only nodes in rich-text mode. These include:

  • spoilers
  • tag badges
  • html-only nodes like <sub>, <sup>, <kbd>

Describe the solution you'd like

Add in a way to add these via rich text. Shortcuts are a given, but perhaps we could add some buttons to the UI somewhere that isn't overly intrusive or cluttered.

Nested <sub> tags not handled properly when switching between modes

https://meta.stackexchange.com/a/360181/395497

In the current editor using nested <sub></sub> html is supported, and can achieve an extra small fontsize. For example: <sub><sub>Extra Small </sub></sub>

When writing this in the Markdown version of the RT editor, and then switching over to RT the first <sub> gets trimmed, the last </sub> doesn't: <sub>Extra Small</sub></sub>

Either nested <sub> statements should be supported, or the last closing argument should also be trimmed.

<code> not rendered correctly; incorrectly escapes when switching

Describe the bug

The Stacks Editor does not properly render <code> elements and incorrectly escapes them when toggling from Markdown mode to rendered mode.

To Reproduce

  1. Start a new post. Make sure you are in Markdown mode, not rendered/rich edit mode.
  2. Enter the following Markdown: <code>this should be code formatted <i>with some italics inside</i></code>
    screenshot of the editor with the sample Markdown input
  3. Click the toggle to switch to rendered/rich edit mode.
  4. Click the toggle to switch back to Markdown mode.

Expected behavior

  • After step 3, the rendered post looks like: this should be code formatted with some italics inside
  • After step 3, the Markdown should be exactly what was entered after step 2

Actual behavior

  • After step 3, the rendered post has literal <code> and </code> shown. None of the sentence has typewriter formatting. The italics are shown correctly:
    screenshot of the incorrectly rendering output

  • After step 3, the Markdown has had <code> changed to `<code>` and similarly for </code>:

    `<code>`this should be code formatted <i>with some italics inside</i>`</code>`
    

    screenshot with the incorrectly escaped Markdown

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox 85.0, Edge 88.0.705.56

Additional context

If I submit the answer/edit without previewing, the <code> elements are rendered correctly.

I first encountered this on a StackOverflow Enterprise installation. I have the same experience on Meta Stack Exchange.

Block node commands misbehaving inside nested block nodes

Reported on Meta.SE

Describe the bug

In Rich Text mode, type some text, click the Blockquote button, then click Bulleted list:

enter image description here

Now when I click the Blockquote button again, I expect the blockquote to disappear (the gray outline indicates it's some kind of toggle, right)? Nope, it's the bulleted list that disappears:

enter image description here

(In Markdown mode, the bulleted list replaces the blockquote formatting, which is OK behaviour IMHO; especially, the buttons don't have a gray outline.)

Unify inserted tables in rich text vs markdown views

Reported on Meta.SE

Tables - this button will create a default three-row, two-column table

For Markdown mode, this is correct. For Rich Text mode, a four-row, three-column table is created:

enter image description here

(tagging this as bug because I don't think the difference is intentional, if it is, the introductory post needs to be updated)

Pressing down arrow key in last table cell sends the cursor to the first cell

Reported on Meta.SE

Describe the bug

The video below shows what happens if one holds the key. I think it'd be preferable if it doesn't loop around, especially since holding the key doesn't loop.

enter image description here

Markdown used in the demo:

| Column A | Column B |
| --- | --- |
|  | A margin call occurs when the value of an investor's |
| [Federal call](https://www.investopedia.com/terms/f/federal-call.asp) | A federal call is a legally mandated margin call pursuant to Regulation T. Investors will receive a federal call when their margin account lacks sufficient equity to meet the initial margin requirement for new, or initial, purchases. |

Tested with Windows 7 SP1 x64 Ultimate and Google Chrome 88.0.4324.190 (Official Build) (64-bit).

Insert a space after certain marks on left arrow key press so they don't trap the cursor.

This is a meta-entry to track items such as #31 and #49.

Is your feature request related to a problem? Please describe.

Specific marks (e.g. code_inline and kbd) appear to "trap" the cursor, even though their behavior is consistent to other marks (e.g. italics or bold). The common behavior is that activating a mark (e.g. ctrl+i for italics) will keep the cursor in that typing mode until it is again deactivated. You can see this behavior in other editors as well. However, some marks that seem like standalone chunks (kbd, code_inline) trigger an expectation in users that they can "leave" these chunks at will by manually moving the cursor with the arrow keys. You can see this behavior in Slack's code formatting.

Describe the solution you'd like

For a small subset of marks, when the user uses the right arrow key to move outside of it and there is no other content to the right of it, disable the mark and add a space. This is consistent with the behavior seen in Slack.

Describe alternatives you've considered

We could just not do anything and consider all marks to behave the same. However, since we have received independent user reports about this behavior, this would likely not be the most UX friendly option.

Add smart linking (such as SE network links)

Reported on Meta.SE.

Describe the bug

Pasting a network link doesn't automatically make it a link in the preview when in rich mode:

Toggling Markdown On and Off again does make the link look properly formatted:

Paste link in rich mode:

Link when switched to Markdown mode:
enter image description here

Link when switched back to rich editor from Markdown mode:
enter image description here

Add the ability to change the code block language in rich text mode

Reported on Meta.SE.

This was mentioned in another answer I believe, but I would like to add some mock UX for an idea of how it can work and look.

I just added an arrow next to the language to make it look like a selector.

When clicking on the language, a dialogue would appear with possible selection. For example, a list similar to the following.

✓ auto
-------
c#
css
html
javascript
plaintext
python

Another idea would be to show a dialogue similar to the image's details dialogue. Although this can be annoying and would much prefer the option above.

enter image description here

Blockquote, etc buttons aren't enabled in list items

Describe the bug

When inside a list item, blockquote, code_block, etc toolbar buttons are disabled. However, pressing enter to get a new item, then backspace to make it a paragraph within the current list item allows you to add block items.

To Reproduce
Steps to reproduce the behavior:

  1. Switch to rich text mode
  2. Type * to get a new list item
  3. Note that blockquotes, etc are not enabled

Expected behavior

We should be allowed to insert blockquotes into list items, wrapping in an enclosing paragraph if we have to.

Horizontal rules are auto-selected on insert

Reported on Meta.SE.

Describe the bug

If you start writing in Rich Text mode and click the ‘Horizontal rule’ button, it’s automatically selected and you can’t deselect it, not even by clicking outside the answer box. Therefore, as soon as you start typing, the horizontal rule disappears.

enter image description here

Expected behavior

The horizontal rule should not be selected. A paragraph should also be inserted below it, with the cursor placed in it.

Add to link reference definition support (bibliography style links)

Reported on Meta.SE.

Blocked by #23

Defaulting to inline links and images in Markdown breaks my workflow. I used the 'link' button a lot on longer posts with lots of links to research articles, as it would start a bibliography. The bibliography format made it easier to provide attribution, especially if I was reusing/quoting the same posts or articles multiple times in the same post. I could just type [text][number of link to reuse] and be done with it. While the syntax for inline links is easy to remember, it doesn't allow for this kind of reuse.

Another great benefit from the bibliography format in the 'old' editor, is that it adds images like this: [![enter image description here][1]][1]. It makes it much easier to hyperlink your image to another site, like this faq explains. Just change the second number, and put another entry in the bibliography list at the bottom of the post. The current editor inserts images using the ![enter image description here](https://i.stack.imgur.com/RRHYf.jpg) format, which gets messy quickly if you want to insert an extra hyperlink... it takes a lot more to memorize how to do that.

And, in long posts with lots of links, having them at the bottom of the post makes the work of potential editors a bit nicer, especially if the links used are long.

I'm not sure why this decision was made, but in my opinion it makes posts messier, not neater. I don't see many support questions on meta from people that are struggling with the bibliography format, so I don't think it's about 'ease of use'. And while the Rich Text editor is there for people that do struggle a bit with writing Markdown, that editor doesn't care how the links are written in Markdown, so those people will never have to know.

As such I'd like to ask you to reconsider defaulting to the inline links, for both links and images.

Urls cause tables to misalign

Reported on Meta.SE

Describe the bug

I attempted to create this table with URLs in the first column:
enter image description here

Adding the URLs to the text causes the table formatting to break. Cells become misaligned. This happens when you are creating/editing the table via rich text and when you are using markdown.
enter image description here

Steps to repro:
Create table, add URL to text either via markdown or using the "insert link" icon

Column A Column B
Cell 1 Cell 2
Cell 3 Cell 4

Was able to do this successfully in MSE editor, had misalignment issue in Teams editor

To Reproduce

Use the following markdown:

| Column A | Column B |
| -------- | -------- |
| [Cell 1](https://meta.stackexchange.com/questions/360033/opt-in-alpha-test-for-a-new-stacks-editor/361096#361096) | Cell 2   |
| Cell 3   | Cell 4   |

Rich-text mode: add empty element after code blocks

When inserting a code block in rich-text mode at the end of the document, it's impossible to move the cursor below the code block. If I wanted to continue writing text after the code block, I can't just put my cursor below the code block (e.g. via mouse click or arrow key navigation) which can be quite jarring. Currently, the only remedy is to hit Mod-Enter within the code block to exit it and insert a newline right after.

For Tables, we do something similar to what I'm proposing here: If there's no subsequent node, we make sure to insert an empty paragraph right after the to-be-inserted table. When inserting commands, we should be able to do the same quite easily. Most likely this is a matter of chaining the "insert code block" command with the "insert empty paragraph if required" command.

Improve code_block tab/indentation

Reported on Meta.SE

The Ctrl+K shortcut is what I always used to indent/unindent code blocks but...

  • it only worked for one-level indentation,
  • not many users knew about it, and...
  • currently, pressing Ctrl+K does nothing while in a code block in the Rich Text mode anyway.

Enabling Tab and Shift+Tab in code blocks will be a great addition.

Any plans to publish ProseMirror utils / markdown-it packages?

Hi! I'm working on an extensible WYSIWYG markdown editor based on ProseMirror, and recently came across this project. Since I was planning to eventually include support for spoilers (inline and block), strikethrough, pipetables, and other non-commonmark features, seeing the progress y'all have made open-sources is extremely exciting! I was wondering if there were any plans to publish some of the markdown-it plugins, prosemirror plugins/commands/utils, etc in a separate package, so they could be used (and contributed to) by other markdown editors? For instance, my use case would include inline spoilers, which aren't currently supported here, but which I'm sure would be useful to your users as well. We'll also eventually want to support a LaTeX input area (probably keeping it raw, but we can't have the input being escaped on serialization).

The code_block command should merge selected paragraphs

Describe the bug

Multiple selected paragraphs are transformed into multiple code blocks in rich text mode

To Reproduce

  1. Type a line of text, then a second, third, ...
  2. Select all three paragraphs and hit the code_block toolbar icon
  3. Note that there are three code_blocks

Expected behavior

There should be a single code_block with all three lines included

Link insertion / editing enhancements

Reported on Meta.SE. Related report here.

Is your feature request related to a problem? Please describe.

Link editing and insertion is currently confusing. The button only highlights when text has already been selected and you cannot insert a link without pre-selecting text.

I’m not sure all users will understand how the ‘Link selection’ button works. (Hint: you have to select the text first, then the button will become enabled.)

Describe the solution you'd like

Other rich text editors I use regularly have an 'Insert Link' button where you can specify both the link and the text to display.
So something like this (excuse the bad mockup, hopefully the idea is clear):

Or enable the button at all times, and if nothing is selected, ask the user for a link (like the current editor) and insert it, with the popover visible so that users know they can edit both the link text and the link itself:

Enter key oddities in Firefox

Reported on Meta.SE.

Describe the bug

  1. Start in Markdown mode
  2. Write any text
  3. Hit the Enter button

I expect the editor to take my cursor to the next line, but it doesn't. I need to hit Enter another time for the cursor to move, but when I restart typing words, they appear on the third line. In other words, the Enter button works, it's just the cursor that's lagging.

Reproducible in Firefox 86, but not in Chrome 88.

Inline code elements trap cursor at the end of a line

Reported on Meta.SE

Related to #31?

Describe the bug

  1. Type in some text, highlight and Ctrl-K to make into an inline code block

  2. <Right-Arrow> to deselect the highlighted text and place your cursor immediately after

  3. Ctrl-K to turn off the inline code block

  4. Start typing (don’t hit the spacebar first no space)

  5. Use your arrow keys to place the cursor immediately before your first plaintext character after the inline code block (or just use your mouse)

  6. Hit the spacebar or type a character

Expected: you are typing in plain text, and not in the inline code block

Currently: you type inside the inline code block. There is no way to get to the plaintext section immediately after the inline code block. The workaround is to type a space at the end of the inline code block, highlight it, Ctrl-K to toggle the inline code block off for that space. But that is really annoying.

Ideally, if you are at the end of the inline code block, you could use your right arrow key to move out of the inline code block and to the spot right after it in the plaintext area, and then use your left arrow key to move back into the tail of the inline code block. (This is how Slack handles the transition between inline code block and plain text areas).

Kbd rich text node traps cursor

Reported on Meta.SE.

Describe the bug

If I want to add some fancy keyboard buttons using <kbd>X</kbd>

X

They show up perfectly in the rich formatting, but when putting your cursor behind the X will make you type inside the kbd element. There is no way to type anything on that same line. Not even forcing your your cursor to appear there by double clicking (as would work in MS Word).

Reproduction steps:

  • Start in markdown mode

  • Add the following text:

    <kbd>X</kbd>
  • Switch to rich text mode

  • Placing the cursor inside the kbd element allows you to edit it, but your cursor is trapped and cannot leave the element

Tooltips are obscuring the editor area and don't disappear on mobile

Reported on Meta.SE

If I want to start a post off with a bolded statement (usually a TL;DR), on mobile I can't see what I'm doing if I use the Rich Text editor, as the 'Bold' label doesn't disappear until I tap the white pop-up:

enter image description here

enter image description here

It would be nice if these things a.) weren't put in a place where they block part of the editor or b.) automatically disappeared (perhaps a short time-out?), so that I can start typing without having to manually dismiss them.

Images being treated as blocks, but should be treated as inline

Reported on Meta.SE

Describe the bug

The following Markdown will produce two images next to each other, but the preview will show them under each other:

![enter image description here](https://i.stack.imgur.com/SQfjes.png)
![enter image description here](https://i.stack.imgur.com/E7aHes.png)

enter image description here
enter image description here

This is what the editor shows:

enter image description here

Triple-click selects the entire text in Markdown mode

Reported on Meta.SE.

Describe the bug

It's a standard practice in modern text fields to double-click in order to select a single word and triple-click to select a single paragraph. This has worked in the old editor, works in the Rich Text editor, but does not work in Markdown mode and the entire text gets selected instead.

Selecting paragraph in Rich Text vs Markdown mode

Expected behavior

The paragraph the cursor is currently in is selected, not the entirety of the text.

Add keyboard shortcuts to tooltips

Reported on Meta.SE

Is your feature request related to a problem? Please describe.

Can we have the toolbar tooltips show the keyboard shortcut for inserting that element into a post, like the previous editor did, so it looks like this:

enter image description here

Some block commands are allowed in code_block nodes

Reported on Meta.SE

Describe the bug

When editing a code block in rich text mode, not all formatting buttons are disabled.

When they are clicked, interesting things happen:

  • Heading

    When clicked, nothing seems to happen, but when the "Markdown" switch is toggled (or if the post is submitted), the code block's first line becomes a heading, and the remaining lines appear as regular text in a single line:

    Heading bug

  • Blockquote

    When clicked, nothing seems to happen, except that the language indicator of the code block breaks. When the "Markdown" switch is toggled (or if the post is submitted), the code block gets contained by a blockquote:

    Blockquote bug

  • Image

    Inserting an image breaks the code block into two parts (separated by the image), the part below the image appears as regular text. When the "Markdown" switch is toggled (or if the post is submitted), the part below the image appears in a single line.

    Image bug

  • Table

    Inserting an image breaks the code block into two parts (separated by the table). If the table is selected and deleted, the code blocks rejoin (expected).

    Table bug

  • Horizontal line

    Inserting a horizontal line breaks the code block into two parts (separated by the line). If the line is selected and deleted, the code blocks rejoin (expected).

    Line bug

  • Link

    When some text is selected within the code block, the link button is enabled, clicking it animates the button but does nothing.

    Link bug

I'm sorry for the low-quality GIFs, but I couldn't upload in higher quality because of the 2MB limit. I hope they are good enough to repro.

Suggestion

All formatting buttons should be disabled in code blocks.

Wrapping the code block in a blockquote might make sense (so it can stay enabled), but it should be fixed to do what it should in this case.

Suggestion: Add a repository description

Is your feature request related to a problem? Please describe.

When I star a repository and come back to it a few months later, I can find it difficult to remember what a repository or project was about by its name alone. Having a repository description assists me in recalling what a project actually does when it is in my list of starred projects.

In addition, it would help new users identify what the project does.

Describe the solution you'd like
I suggest adding a GitHub description to this repository. Maybe it could also go at the top of the README too?

Describe alternatives you've considered
I could build an entire custom GitHub starred projects manager in which I could have a local override..... but that seems like too much work for such a trivial problem.

Additional context
Came from a StackExchange blog post, but got momentarily confused as to whether I was even in the right repository or not.

Add ability to select table rows/columns

Reported on Meta.SE

Is your feature request related to a problem? Please describe.

When trying to select a row of a table in the rich editor, you select only the contents of a single cell. If you drag further you select the contents of the next cell, etc. There is no way to select the entire row.

Can we please make it such that we can do the intuitive thing here and select an entire row and remove it by pressing backspace / delete. Instead of having to go through the dropdown-menu to remove a row.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.