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 mangle numeric lists! #2

Merged
merged 4 commits into from Apr 25, 2015

Conversation

Projects
None yet
2 participants
@rjbs
Contributor

rjbs commented Apr 24, 2015

Given a list like this:

  1. foo
  2. bar
  3. baz

You should get:

  1. foo
  2. bar
  3. baz

…and you do. If you use non-ASCII number characters, though, it gets mucked up. I'll use "full width" Arabic numerals here, for easy reading by Western eyes. Given this input:

1. foo
3. bar
2. baz

…we get this output:

1. foo

  1. bar
  2. baz

The first digit is kept as a number, but then we try adding 1 to it, and it's treated like a bogus string and we get a non-numeric warning and 1. Because non-number plus 1 is 1. Ho ho!

This branch just stops trying to handle these. For now!

rjbs added some commits Apr 24, 2015

remove pointless "use utf8;"
There is no non-ASCII in the source file, and nothing in the file
uses anything in the utf8 namespace.
only renumber ASCII-digit lists (for now, anyway)
We could definitely properly renumber these lists, but we'd need to
require a newer perl, almost certainly, to get the conversion
routines between digit characters and numbers.  This commit, at
least, keeps us from mangling perfectly good text.
@rjbs

This comment has been minimized.

Show comment
Hide comment
@rjbs

rjbs Apr 24, 2015

Contributor

It's tempting to want to support non-ASCII lists when the numbering is all composed of digits. I think it's possible, using Unicode::UCD to ensure that the first digit is a kind of "1" and go from there. I don't promise to do this any time soon.

Contributor

rjbs commented Apr 24, 2015

It's tempting to want to support non-ASCII lists when the numbering is all composed of digits. I think it's possible, using Unicode::UCD to ensure that the first digit is a kind of "1" and go from there. I don't promise to do this any time soon.

@rjbs

This comment has been minimized.

Show comment
Hide comment
@rjbs

rjbs Apr 25, 2015

Contributor

I'm officially giving up my half-hearted attempt to handle non-ASCII lists. It's silly to try to handle cases where the bullet numbers are not all in one script, and it's a pain to ensure that they are because of how state is collected and munged. It could be done, but I think it would just be showing off. So, by aborting this work, I avoid sin.

The PR is good to merge, otherwise. Nihil obstat.

Contributor

rjbs commented Apr 25, 2015

I'm officially giving up my half-hearted attempt to handle non-ASCII lists. It's silly to try to handle cases where the bullet numbers are not all in one script, and it's a pain to ensure that they are because of how state is collected and munged. It could be done, but I think it would just be showing off. So, by aborting this work, I avoid sin.

The PR is good to merge, otherwise. Nihil obstat.

@neilb

This comment has been minimized.

Show comment
Hide comment
@neilb

neilb Apr 25, 2015

Owner

Showing off in a shadowy corner, to improve something that people use, where those people wouldn't be aware of the showing off, doesn't sound like very much of a sin.

Owner

neilb commented Apr 25, 2015

Showing off in a shadowy corner, to improve something that people use, where those people wouldn't be aware of the showing off, doesn't sound like very much of a sin.

neilb added a commit that referenced this pull request Apr 25, 2015

@neilb neilb merged commit fa95c0b into neilb:master Apr 25, 2015

@neilb

This comment has been minimized.

Show comment
Hide comment
@neilb

neilb Apr 25, 2015

Owner

Thank you!

Owner

neilb commented Apr 25, 2015

Thank you!

@neilb

This comment has been minimized.

Show comment
Hide comment
@neilb

neilb Apr 25, 2015

Owner

Developer release 1.69_01 making its way to CPAN.

Owner

neilb commented Apr 25, 2015

Developer release 1.69_01 making its way to CPAN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment