Skip to content

Conversation

@jleandroperez
Copy link
Contributor

Details:

This is the (last) PR in the series "Let's stop using the Zero Width Spacing" character. We're replicating the exact same mechanisms (+ battle of unit tests) we've already got for Lists and Blockquotes.

Needs Review: @diegoreymendez
Thaaanks!!!

Closes #420
Closes #414

Testing:

Verifying this PR is gonna be a bit tricky, since we don't really have (yet) a way to toggle Pre blocks. Parsing from HTML is supported, but visual edition hasn't been shipped yet.

In this PR i've added a togglePre method, analog to toggleList and toggleBlockquote. In order to verify this PR, please:

  • Make sure the unit tests pass
  • Whenever the test scenario indicates "Toggle Pre", please:
    A. Switch to HTML
    B. Insert <pre>Payload</pre>
    C. Switch back!

Apologies about this inconvenience. We don't really have a Pre gridicon we could wire, right now, for this PR. Formal support coming in later, in another PR!

--

Scenario A: Missing Pre after Backspace

  1. Launch the empty editor
  2. Toggle the Pre format
  3. Enter any random text
  4. Hit backspace

Verify that the pre style is still present.

Scenario B: Nuking Pre after Backspace

  1. Launch the empty editor
  2. Insert Pre Tag
  3. Enter any random text
  4. Select the end of the document
  5. Hit backspace

Verify that the Pre gets effectively removed.

Scenario C: Newline after Pre

  1. Launch the empty editor
  2. Insert Pre Tag

Verify that a newline is inserted below the pre.

Scenario D: Nuking bottom \n and adding newlines

  1. Launch the empty editor
  2. Toggle the Pre format
  3. Enter any random text
  4. Select the end of the document
  5. Hit backspace
  6. Hit \n and enter any random text

Verify that the new Pre line gets it's proper style, even when the bottom \n was initially nuked.

Scenario E: Typing Attributes below Pre

  1. Launch the empty editor
  2. Insert Pre Tag
  3. Press the arrow down

Verify that the Pre gets removed from the typing attributes (and that the text indentation looks normal).

Scenario F: Autoremoval after hitting return on newline

  1. Launch the empty editor
  2. Insert Pre Tag
  3. Hit return

Verify that the blockquote gets removed.

Copy link
Contributor

@diegoreymendez diegoreymendez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @jleandroperez !

@jleandroperez
Copy link
Contributor Author

WOOOOOOOO Thank you Diego!!!

@jleandroperez jleandroperez merged commit 68f6bcc into develop Apr 20, 2017
@jleandroperez jleandroperez deleted the issue/422-nuking-zero-width-spaces-from-preformatter branch April 20, 2017 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants