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

Don't insert empty titles #89

Closed
wants to merge 2 commits into from
Closed

Don't insert empty titles #89

wants to merge 2 commits into from

Conversation

swsnr
Copy link
Contributor

@swsnr swsnr commented Feb 3, 2016

Guard against title being an empty string. There's no use in inserting empty titles, or did I miss something?

@@ -2909,7 +2909,7 @@ be used to populate the title attribute when converted to XHTML."
(insert url)
;; When no URL is given, leave cursor at END following the colon
(setq end (point)))
(when title
(when (and title (> (length title) 0))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is (> (length title) 0) enough ? Because (length nil) returns 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, indeed, didn't think of this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@syohex I've simplified the check to (> (length title) 0)

@jrblevin
Copy link
Owner

jrblevin commented Feb 8, 2016

Thanks!

@jrblevin jrblevin closed this Feb 8, 2016
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