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

Fix issue with emphasis and whitespace #177

Merged
merged 4 commits into from
Aug 13, 2017

Conversation

jonathan-s
Copy link
Contributor

This fixes some issues that occurs with white spaces around the following emphasis marks ~~, **, _. It's not the most beautiful code, but it fixes the bugs.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.0%) to 96.309% when pulling faf0e6b on jonathan-s:emphasis-fix into 0ea76a4 on Alir3z4:master.

@coveralls
Copy link

coveralls commented Aug 11, 2017

Coverage Status

Coverage decreased (-0.2%) to 98.098% when pulling a18c358 on jonathan-s:emphasis-fix into 0ea76a4 on Alir3z4:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 98.098% when pulling a18c358 on jonathan-s:emphasis-fix into 0ea76a4 on Alir3z4:master.

@jonathan-s
Copy link
Contributor Author

ping @Alir3z4

@Alir3z4 Alir3z4 self-requested a review August 12, 2017 10:26
@Alir3z4 Alir3z4 self-assigned this Aug 12, 2017
Copy link
Owner

@Alir3z4 Alir3z4 left a comment

Choose a reason for hiding this comment

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

Code looks good, I have only small change request regarding the coding style that would be good to know what you think.

Also please add the changes to ChangeLog as well.

@@ -376,15 +381,38 @@ def handle_tag(self, tag, attrs, start):
self.blockquote -= 1
self.p()

def no_preceding_space(self):
Copy link
Owner

Choose a reason for hiding this comment

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

Instead of using an if condition here, could this be on-line like:

def no_preceding_space(self):
     return self.preceding_data and re.match(r'[^\s]', self.preceding_data[-1])

In this way the function always returns a bool.

Copy link
Owner

Choose a reason for hiding this comment

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

A small docstring would be great, although it's not necessary. The function name speaks by itself.
Good function naming

@@ -769,6 +797,19 @@ def o(self, data, puredata=0, force=0):
self.outcount += 1

def handle_data(self, data, entity_char=False):

Copy link
Owner

Choose a reason for hiding this comment

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

This blank line can be removed.

@Alir3z4
Copy link
Owner

Alir3z4 commented Aug 12, 2017

@jonathan-s Thanks** for the great work.
I left some change requests

@coveralls
Copy link

coveralls commented Aug 12, 2017

Coverage Status

Coverage decreased (-0.2%) to 98.096% when pulling a5b2824 on jonathan-s:emphasis-fix into 0ea76a4 on Alir3z4:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 98.096% when pulling 5aa7c11 on jonathan-s:emphasis-fix into 0ea76a4 on Alir3z4:master.

6 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 98.096% when pulling 5aa7c11 on jonathan-s:emphasis-fix into 0ea76a4 on Alir3z4:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 98.096% when pulling 5aa7c11 on jonathan-s:emphasis-fix into 0ea76a4 on Alir3z4:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 98.096% when pulling 5aa7c11 on jonathan-s:emphasis-fix into 0ea76a4 on Alir3z4:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 98.096% when pulling 5aa7c11 on jonathan-s:emphasis-fix into 0ea76a4 on Alir3z4:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 98.096% when pulling 5aa7c11 on jonathan-s:emphasis-fix into 0ea76a4 on Alir3z4:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 98.096% when pulling 5aa7c11 on jonathan-s:emphasis-fix into 0ea76a4 on Alir3z4:master.

@jonathan-s
Copy link
Contributor Author

@Alir3z4 All set! Tests are passing and I made the requested changes!

Copy link
Owner

@Alir3z4 Alir3z4 left a comment

Choose a reason for hiding this comment

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

Awesome work.

@Alir3z4 Alir3z4 merged commit 32fcace into Alir3z4:master Aug 13, 2017
@Alir3z4
Copy link
Owner

Alir3z4 commented Aug 13, 2017

@jonathan-s Thanks, awesome work.

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.

3 participants