-
Notifications
You must be signed in to change notification settings - Fork 125
Should recognize generic syntax in plain text in dart docs rather than treating it as HTML #1250
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
Comments
How do we want it to be fixed?
What do you think? /cc @devoncarew |
Personally I'd be fine with not supporting HTML at all, except that we use it in a few places:
|
Don't check for a closing tag, those are sometimes optional in HTML (and indeed are omitted in both of the cases above). |
Hm, I just noticed that mixing markdown and markup in Element.updateChild isn't working. For tables I guess we really just want true markdown tables. |
It seems like just having this would solve the problem described in this ticket, right? |
Yeah that would be fine by me. We'll have to figure out what to do with the Element.updateChild case though. |
I will look at it. |
Actually, @Hixie, if you write it like this:
(i.e. in square brackets), it will look right. Would that solve the problem for you? |
What does it hyperlink to? |
|
Sounds good to me. In that case I guess the problem boils down to us detecting cases of invalid HTML in our dartdoc markdown. |
Umm, what for? Could you give an example? |
To catch the cases where I incorrectly did things like |
Oh, gotcha. So, basically it will be a whitelist of tags? And a warning in the console output if it's not in a whitelist? |
Oh that would be amazing, yeah. I actually just meant that we'd run some HTML validator over the site, but if you can actually catch things at build time that'd be even better. In general my dream is to get to a point where any time there's anything wrong with the docs (including any time we use |
Right now I don't see any warning/error system in dartdoc, probably would be a good idea to add. |
@Hixie asked for warnings when the generics are "free-hanging", and not wrapped into [] block (like Apple<Cat>, but not [Apple<Cat>]). This commit adds those warnings. We try to find tags, not wrapped into square brackets, which is not from the whitelist of possible HTML tags. Also, now output all the warnings to the console: * When there's a missing reference in the comments * When there's ambiguous reference in the comments * When there's "free-hanging" generics But that generates TONS AND TONS of warnings when you e.g. generate Dart SDK docs or Flutter docs. So, I've added a flag `--show-warnings`, without it we won't show the warnings.
@Hixie asked for warnings when the generics are "free-hanging", and not wrapped into [] block (like `Apple<Cat>`, but not `[Apple<Cat>]`). This commit adds those warnings. We try to find the tags, which are not wrapped into square brackets, which are not from the whitelist of possible HTML tags. Also, now output all the warnings to the console: * When there's a missing reference in the comments * When there're ambiguous reference in the comments * When there're "free-hanging" generics But that generates TONS AND TONS of warnings when you e.g. generate Dart SDK docs or Flutter docs. So, I've added the flag `--show-warnings`, without it we don't show the warnings.
* Add warnings for "free-hanging" generics in docs [#1250] @Hixie asked for warnings when the generics are "free-hanging", and not wrapped into [] block (like `Apple<Cat>`, but not `[Apple<Cat>]`). This commit adds those warnings. We try to find the tags, which are not wrapped into square brackets, which are not from the whitelist of possible HTML tags. Also, now output all the warnings to the console: * When there's a missing reference in the comments * When there're ambiguous reference in the comments * When there're "free-hanging" generics But that generates TONS AND TONS of warnings when you e.g. generate Dart SDK docs or Flutter docs. So, I've added the flag `--show-warnings`, without it we don't show the warnings. * Address feedback
The following comment:
...turns into the text "This class specializes the interpolation of Tween to be" because the
<int>
part is treated like HTML markup.The text was updated successfully, but these errors were encountered: