-
Notifications
You must be signed in to change notification settings - Fork 182
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
Cross-references broken when ref includes special characters (e.g., hyphens or underscores) #444
Comments
As a workaround, you can use The current code strips non-ASCII-alphanumeric characters from the evidence name when generating it's ref, but the |
@ColonelThirtyTwo Yeah, let's try using quotes. If it works, that's the better solution. Escaping quotes is easy enough, and it should be unlikely that someone uses double quotes in a name anyway. This would also avoid a situation where someone could have |
Speaking of duplicate evidence files, there does not appear to be any checks to block that. I'm able to create two evidence items with the same name. So, quoting the evidence names wouldn't help here. I think this indicates that there are two issues:
|
Could we concatenate the evidence friendly name and the evidence ID when generating the DOCX? This should prevent naming collisions, even if multiple evidence items have the same friendly name. For example:
|
Name+ID could still theoretically experience collisions but I think a user would really have to go out of their way (or, be incredibly [un]lucky) to encounter it. For example:
|
Keep in mind that captions made with But I can see name collisions being an issue moving forward, especially with extra fields attempting to generate an evidence figure multiple times. |
Describe the bug
References that include hyphens or underscores are broken in the generated DOCX.
To Reproduce
Steps to reproduce the behavior:
{{.example-ptc}}
{{.ref example-ptc}}
{REF _Refexample-ptc \h}
{REF _Refexampleptc \h}
and updating the reference (F9) fixes the broken referenceExpected Behavior
Special characters that would break DOCX XML should be stripped when generating the report. Or, they should be blocked from being used in the UI.
Server Specs:
Additional context
I'm working on some other figure caption code so I may have some upcoming PRs that may cover this. But, documenting this behavior here in case other priorities come up and for feedback on if this reproducible.
The text was updated successfully, but these errors were encountered: