-
Notifications
You must be signed in to change notification settings - Fork 45
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
Stardoc over-escapes angle brackets in docstrings. #137
Comments
Examples to demonstrate bazelbuild#137.
Examples to demonstrate bazelbuild#137.
Examples to demonstrate bazelbuild#137.
I think the
is another case of this bug? |
This is somewhat different, as it's arguable that this is a bug in the source of that documentation rather than in the translation thereof, though the backwards-compatibility argument for saying it's a bug on this end is pretty strong. It's also a bit of an oddball case, since the docstring there is defined in Java rather than Starlark. At any rate, we can't really expect it to be able to guess whether |
Hm that's interesting that the two newlines in that doc string get lost as well. The paragraph tag shouldn't be needed if docs are markdown and there is a blank line in between. |
I opened #138 to add some (failing) test cases demonstrating some of these problems. However unless I'm mistaken the code to fix this issue lives somewhere in the java code of https//github.com/bazelbuild/bazel, so it can't be fixed via a PR in this repo. |
Examples to demonstrate bazelbuild#137.
Examples to demonstrate bazelbuild#137.
Examples to demonstrate bazelbuild#137. Co-authored-by: Adam Azarchs <adam.azarchs@10xgenomics.com>
Examples to demonstrate bazelbuild#137. Co-authored-by: Adam Azarchs <adam.azarchs@10xgenomics.com>
Examples to demonstrate bazelbuild#137. Co-authored-by: Adam Azarchs <adam.azarchs@10xgenomics.com>
Examples to demonstrate bazelbuild#137. Co-authored-by: Adam Azarchs <adam.azarchs@10xgenomics.com>
Examples to demonstrate bazelbuild#137. Co-authored-by: Adam Azarchs <adam.azarchs@10xgenomics.com>
Examples to demonstrate bazelbuild#137. Co-authored-by: Adam Azarchs <adam.azarchs@10xgenomics.com>
Reverts #133 so that HTML escaping is not applied to Markdown. Instead, Markdown content such as docstrings can use HTML formatting and escape angle brackets with backslashes, HTML entities or inline code segments. Default values are embedded in inline code segments instead of `<code>` tags, which does not require escaping. As a result, docstrings behave just like regular Markdown contexts while default values are rendered without smart quotes and can contain both `<` and `` ` `` without causing escaping issues. Also includes tests based on #138. Fixes #137 Closes #138 Fixes #142 Closes #143 Requires bazelbuild/bazel#18867 Co-authored-by: Adam Azarchs <adam.azarchs@10xgenomics.com>
Unfortunately, while #133 fixed a bunch of things, it also broke a bunch of other things. In particular, if one has a rule or respository rule with a
doc
attribute likeit will be converted to
which renders as
The issue here, of course, is the mismatch between using HTML tags (e.g.
<pre>
or<code>
) for formatting in some situations (e.g. tables), and native markdown formatting in others. One must use escaping in the former situation, but using it in the latter breaks stuff.The text was updated successfully, but these errors were encountered: