Skip to content
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

Issue with substituting curly braces {} #276

Open
bshaffer opened this issue May 25, 2021 · 1 comment
Open

Issue with substituting curly braces {} #276

bshaffer opened this issue May 25, 2021 · 1 comment
Assignees

Comments

@bshaffer
Copy link

bshaffer commented May 25, 2021

The DescriptionFactory class is replacing all instances of {} with }, and does not (and cannot) revert them back to {} upon render. As a result, any instance of {} in any docblock is incorrectly changed.

This happens here. The only way I can see to get around it is to create a new DescriptionFactory class, which contains the identical code to this class, with the exception of that one line.

I request that this library either:

  1. Properly substitute the {} back in during render
  2. Provide an easier way to bypass replacing {}.

I'm happy to submit the fix myself if the maintainers would like to weigh in on their preference. When I removed the substitution of {}, I have found no adverse effects, so I may need more guidance as to why this is necessary before submitting a change.

Thanks for this great library!

Related: #274

@jaapio
Copy link
Member

jaapio commented Aug 6, 2021

Hi,

Somehow, your requests slipped through. This library doesn't have our main focus as it has nearly any bugs that are preventing people from doing their work. Sorry for that.

{} as commented in the lines you found in the DescriptionFactory has a special purpose in docblocks to allow inline tags. Before I can answer you question properly, could you please provide an example where this replacement gives issues in our documentation process?

The {} was intended to be able to escape } in your docblocks. for example

/**
 * My method
 *
 * This is a docblock containing an inline tag to explain escaping for {@{} and {{}
 * {@see DescriptionFactory will replace {{} to allow closing braces in your description}
 */

The {} notation is quite old. Removing this escape option would break the usage of docblocks for other people. So when possible I would recommend you to change your docblocks to use {{} in order get the result {} in your documentation.

Please let us know if this helps you to understand the behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants