Skip to content

Fix truncation in middle of links for constants #1544

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

Merged
merged 3 commits into from
Nov 28, 2017

Conversation

jcollins-g
Copy link
Contributor

@jcollins-g jcollins-g commented Nov 27, 2017

Fixes #1535. Third breakout from #1524 -- necessary because #1535 becomes much worse with the overhaul as more classes are made linkable. Without this change #1535 would become a P1 post-overhaul as Flutter docs would begin generating broken links and warning about them.

Rearranges how constantValue is calculated, factoring it out into GetterSetterCombo and substituting any links in after truncating and escaping, rather than before.

@googlebot googlebot added the cla: yes Google CLA check succeeded. label Nov 27, 2017
}

String linkifyWithModelType(String text) {
RegExp r = new RegExp("\\b${modelType.name}\\b");
Copy link
Member

Choose a reason for hiding this comment

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

Is this called frequently? If so, we may want to cache the regexp in an instance field.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This method is not called very often per GetterSetterCombo (maybe twice?). Probably not worth it at this point.

@jcollins-g jcollins-g merged commit 6c14fd2 into master Nov 28, 2017
@jcollins-g jcollins-g deleted the constants-invalid-html-breakout branch November 28, 2017 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants