Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#877] Fix for error in PFW when bullets use special char #902

Merged
merged 6 commits into from
Oct 6, 2017
Merged

Conversation

msamsel
Copy link
Contributor

@msamsel msamsel commented Sep 13, 2017

What is the purpose of this pull request?

Bug fix

Does your PR contain necessary tests?

yes

This PR contains

  • Unit tests
  • Manual tests

What changes did you make?

  • Change validation condition which process lists pasted from word.

Close #877

@msamsel msamsel changed the title [#877] Fix for error in PFW when bullets use special char. [#877] Fix for error in PFW when bullets use special char Sep 25, 2017
@f1ames f1ames self-requested a review September 29, 2017 09:19
Copy link
Contributor

@f1ames f1ames left a comment

Choose a reason for hiding this comment

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

Looks good, two small adjustments needed.

Also two of the new tests fails in Edge (checked in version 14 and 16):

screen shot 2017-09-29 at 12 55 52

@@ -1085,7 +1085,8 @@
symbol = element.attributes[ 'cke-symbol' ];

element.forEach( function( node ) {
if ( !removed && node.value.match( symbol.replace( ')', '\\)' ).replace( '(', '' ) ) ) {
// Changing `match` -> `indexOf`, symbol is String not RegExp (#877).
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment is true, however if you look at the match docs:

A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj)...

which means it can be used with a String too. I assume what was the intention of this comment, but maybe it will be better to put here something like:

Since symbol may contains special characters we use simple indexOf instead of RegExp which is sufficient (#877).


----
1. Open browser console.
1. Open [file](../generated/_fixtures/Unordered_list_special_char_bullet/Unordered_list_special_char_bullet.docx) in Word.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you can put file name here as a link [Unordered_list_special_char_bullet.docx](...)?

Copy link
Contributor

@f1ames f1ames left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@f1ames f1ames merged commit be5e952 into major Oct 6, 2017
@f1ames f1ames deleted the t/877 branch October 6, 2017 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom bullets with exotic chars crashes in paste from Word
2 participants