-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Enable checkboxes (currently disabled) #94
Comments
The problem is that the markdown file is not updated in display mode .. I don't understand the additional value of being able to flag the checkbox .. |
The intent is not to have the check state persist but rather to follow steps, for example, as you're going through instructions. The state of the checkboxes being ephemeral and resetting on page reload is totally fine. As an example I am updating some financial workflow documentation for my wife and have a bulleted list for the steps to follow (example are download financial transactions, import transaction, categorize transactions, etc). This gets done every week or two. Having a simple checklist right in the wiki document she can use to keep track of her steps would be helpful. It can be easy to lose your place while following steps with just bulleted lists. She could have a separate app / lists elsewhere but that's yet another window / app she then has to keep open and juggle around to. Much easier to do right along with the instructions. I grant that checkboxes in a wiki page seem a bit odd but to me it's odder (and more frustrating) to have checkboxes render but then not be usable. To me it does not make sense to have them disabled because then what would be the point of using them over a bulleted list? They have a separate and valuable purpose over bulleted lists but are hampered by being disabled. |
oh wow.. It is really a good idea to use them as a checklist. |
Amazing! Looking at the doc for ParsedownExtended it refers to the checkboxes as 'tasks' and they should be enabled by default, I think. Searching the WikiDocs code I see the following block which seems to be setting tasks to true (i.e. enabled) if there is no value set in // Task
$state = $this->options['lists']['tasks'] ?? true;
if ($state !== false) {
$this->BlockTypes['['][] = 'Checkbox';
} As far as I can tell that should evaluate It's also interesting to see $state reused over and over again in that file (which I've always been told is not good practice) so maybe it's getting set to |
Looking again I don't see how the above code can even effect the protected function checkboxUnchecked($text)
{
if ($this->markupEscaped || $this->safeMode) {
$text = self::escape($text);
}
return '<p><label><input type="checkbox" disabled /><span> '.$this->format($text).'</span></label></p>';
}
protected function checkboxChecked($text)
{
if ($this->markupEscaped || $this->safeMode) {
$text = self::escape($text);
}
return '<p><label><input type="checkbox" checked disabled /><span> '.$this->format($text).'</span></label></p>';
} It's a big unclear to me how to apply enforce the For now I have just bind mounted the |
Describe the feature
Would like to be able to check / uncheck checkboxes in wiki pages. They render with the common syntax of
- [ ]
but are disabled and cannot be checked / unchecked.The HTML in the browser shows
<input type="checkbox" disabled>
. If I remove the 'disabled' attribute in the browser dev tools the checkboxes work beautifully.I don't see a way to enable them with overrides like with the css styles or js scripts. The 'disabled' properly seems to be baked into the ParsedownExtended.php file.
https://github.com/Zavy86/WikiDocs/blob/1dcc28070df28290cab46edc2b02c9458634d9af/libraries/parsedown-extended-1.1.2-modified/ParsedownExtended.php#L1316C51-L1316C58
Is your feature request related to a problem? (optional)
No response
Screenshots (optional)
Current / default behaviour
Desired behaviour
Extra fields
The text was updated successfully, but these errors were encountered: