hummingbird-dev / hummingbird-treeview

A powerful and fast jQuery treeview plugin
MIT License
62 stars 23 forks source link

Converter does not support using hypens anywhere in the text of your label. #2

Closed LandonHammond closed 6 years ago

LandonHammond commented 6 years ago

Converter errors if there are any hypens in the text of your checkbox label.

Throws error:

The item after ' + treeText + ' has too much hyphens, i.e. it is too far intended. Note that down the tree, the items are only allowed to be intended by one instance, i.e. one hyphen more than the item before. In contrast, up the tree arbitrarily large jumps are allowed.

Example markup that fails:

<div class="hummingbird-treeview-converter">
        <li>Warner Bros.</li>
        <li>-Goodfe-llas</li>
        <li>--Robert De Niro</li>
        <li>--Joe Pesci</li>
        <li>-The Shawshank Redemption</li>
        <li>--Tim Robbins</li>
        <li>--Morgan Freeman</li>
        <li>Paramount</li>
        <li>-The Untouchables</li>
        <li>--Robert De Niro</li>
        <li>--Kevin Costner</li>
        <li>-Forrest Gump</li>
        <li>--Tom Hanks</li>
        <li>--Robin Wright</li>
</div>
hummingbird-dev commented 6 years ago

Great catch. Thanks. I've merged your pull request.

LandonHammond commented 6 years ago

Cool, thanks.