Skip to content

fix (taBind): Fix broken HTML when list elements have an attribute.#1573

Open
davidmdem wants to merge 1 commit intotextAngular:masterfrom
davidmdem:fix-list-indent
Open

fix (taBind): Fix broken HTML when list elements have an attribute.#1573
davidmdem wants to merge 1 commit intotextAngular:masterfrom
davidmdem:fix-list-indent

Conversation

@davidmdem
Copy link
Copy Markdown

Currently, the formatter in taBind will hard cut off list elements at the 4th character. This means that a class or style attribute can by typed and saved, but when the data is reloaded/bound any attributes are cut off and broken HTML is displayed.

This can be reproduced in the taBind.$formatters.spec.js tests for indenting lists.

Adding the following test to the current master branch will reproduce the failure:

        it('handle lists with attributes', function(){
            $rootScope.html = '<ul style="font-size: 10pt;"><li>Test Line 1</li><li>Test Line 2</li><li>Test Line 3</li></ul>';
            $rootScope.$digest();
            expect(element.val()).toBe('<ul style="font-size: 10pt;">\n\t<li>Test Line 1</li>\n\t<li>Test Line 2</li>\n\t<li>Test Line 3</li>\n</ul>');
        });

The test above and a fix are included in this PR. Thank you!

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.

1 participant