Skip to content

Julia component generator should escape $ within docstrings #1269

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

Closed
rpkyle opened this issue May 23, 2020 · 2 comments
Closed

Julia component generator should escape $ within docstrings #1269

rpkyle opened this issue May 23, 2020 · 2 comments

Comments

@rpkyle
Copy link
Contributor

rpkyle commented May 23, 2020

Following my attempt to build DashTable.jl, the following error appeared:

[ Info: Precompiling DashTable [1b08a953-4be3-4667-9a23-759fc69216d1]
ERROR: LoadError: LoadError: syntax: invalid interpolation syntax: "$'"

The culprit appears to be two occurrences of $' within the docstring, based on my reading of this issue: JuliaLang/julia#10816.

We should modify the component generator to prepend a \ to escape $ whenever they occur, which should resolve the error at component build time in the future.

A similar change was made for the R component generator, to address unescaped backslashes:

# auto-replace any unescaped backslashes for compatibility with R docs
description = re.sub(r"(?<!\\)%", "\\%", description)
item_text = re.sub(r"(?<!\\)%", "\\%", item_text)

@alexcjohnson
Copy link
Collaborator

@waralex included this in #1302 - now part of #1189 -> here

I haven't tried building DashTable.jl yet but I'm assuming this is fixed.

@rpkyle
Copy link
Contributor Author

rpkyle commented Aug 14, 2020

@waralex included this in #1302 - now part of #1189 -> here

I haven't tried building DashTable.jl yet but I'm assuming this is fixed.

Yep, looks to have been fixed:

docstring = (
create_docstring_jl(
component_name=name, props=filtered_props, description=description
)
.replace("\r\n", "\n")
.replace("$", "\\$")
)

I'll go ahead and close now.

@rpkyle rpkyle closed this as completed Aug 14, 2020
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

No branches or pull requests

2 participants