Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

fix(accessibility): improve output for long elements #1900

Closed
wants to merge 1 commit into from

Conversation

juliemr
Copy link
Member

@juliemr juliemr commented Mar 5, 2015

Instead of just printing the first N characters of the element's template,
print the first and last N/2.

See #1854

Instead of just printing the first N characters of the element's template,
print the first and last N/2.

See angular#1854
@@ -175,6 +175,15 @@ function runChromeDevTools(config) {
var elementPromises = [],
elementStringLength = 200;

function trimText(text) {
if (text.length > elementStringLength) {
return text.substring(0, elementStringLength / 2) + ' ... '
Copy link
Contributor

Choose a reason for hiding this comment

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

This will have a total length of elementStringLength + 5. Is that correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah (there's also some tabs at the beginning, so it's not the whole output string length anyway...).

@sjelin
Copy link
Contributor

sjelin commented Mar 5, 2015

LGTM

@marcysutton
Copy link
Contributor

👍

@juliemr
Copy link
Member Author

juliemr commented Mar 9, 2015

Thanks! Merged as fb92be6

@juliemr juliemr closed this Mar 9, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants