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

Support for pretty="none" #326

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

elliottslaughter
Copy link
Contributor

This adds support for setting pretty="none" to work around #162. Doing so disables the prettifier so that it doesn't mess up the parsing of other Markdown constructs.

The defval = defval or false part was deleted because it was preventing the pretty value from being read from config.ld. Actually, this was a bug even before adding the none value: e.g. you couldn't set pretty="lxsh" before this patch. However, it may be worth double checking if this breaks anything else, since I'm not sufficiently aware of the rest of the code base to know what else this may have interacted with.

Copy link
Member

@alerque alerque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to contribute. This looks like a good thing to fix, but I'm not sure this implementation is quite right. Are you still using this?

@@ -171,7 +171,6 @@ doc.ldoc = ldoc

-- if the corresponding argument was the default, then any ldoc field overrides
local function override (field,defval)
defval = defval or false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line was to cast possible nil values to a boolean false. I think it was probably correct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See also #118.

doc/doc.md Show resolved Hide resolved
@elliottslaughter
Copy link
Contributor Author

elliottslaughter commented Sep 29, 2020

To be honest, I've entirely swapped this out of memory, so I can't remember why the defvar line was removed (edit: aside from what I wrote in the original PR). But yes, we are still using this and the ability to set none (or however you want to spell it, false or whatever) does matter to us.

@alerque
Copy link
Member

alerque commented Sep 29, 2020

Can you test your usage with that line put back in? It looks right to me, and there is a big difference between nil and false. It make well be needed, but I'd like to understand why it was removed and what the case(es) are that are affected before I consider merging. Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants