deck icon indicating copy to clipboard operation
deck copied to clipboard

Checklists break (markdown) styled text in description field

Open hrk opened this issue 6 years ago • 7 comments

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Describe the bug Styled text is broken when using checklists.

This happens with the new markdown-it engine, can't check the old engine.

To Reproduce Steps to reproduce the behavior:

  1. Create new task in a stack
  2. Put a styled checklist
  3. Switch to view/preview
  4. See broken style

Expected behavior View correctly styled text

Screenshots Put the following text in a new task in Deck and in https://markdown-it.github.io/

- [X] Completed task
- [ ] Open task
- [ ] ~~Canceled task, would like to have a strikethrough~~ with further comments explaining the reason for the strikethrough.
- [X] _Don't really need it myself, but italic is broken too_
- [x] __As is bolded text__

Client details:

  • OS: Linux
  • Browser: Firefox (didn't test others)
  • Version: 68.10.0esr
  • Device: personal workstation
Server details

Operating system: Linux (Gentoo)

Web server: Apache 2.4.41

Database: PostgreSQL

PHP version: 7.4.6

Nextcloud version: 18.0.6

Where did you install Nextcloud from: official Gentoo ebuild repository

Signing status:

 files_rightclick
	- EXTRA_FILE
		- README.md

List of activated apps:

Enabled:
  - accessibility: 1.4.0
  - activity: 2.11.0
  - cloud_federation_api: 1.1.0
  - comments: 1.8.0
  - dav: 1.14.0
  - deck: 1.0.4
  - federatedfilesharing: 1.8.0
  - federation: 1.8.0
  - files: 1.13.1
  - files_pdfviewer: 1.7.0
  - files_rightclick: 0.15.2
  - files_sharing: 1.10.1
  - files_trashbin: 1.8.0
  - files_versions: 1.11.0
  - files_videoplayer: 1.7.0
  - firstrunwizard: 2.7.0
  - logreader: 2.3.0
  - lookup_server_connector: 1.6.0
  - nextcloud_announcements: 1.7.0
  - notes: 3.6.0
  - notifications: 2.6.0
  - oauth2: 1.6.0
  - password_policy: 1.8.0
  - photos: 1.0.0
  - privacy: 1.2.0
  - provisioning_api: 1.8.0
  - recommendations: 0.6.0
  - serverinfo: 1.8.0
  - settings: 1.0.0
  - sharebymail: 1.8.0
  - support: 1.1.1
  - survey_client: 1.6.0
  - systemtags: 1.8.0
  - tasks: 0.13.1
  - text: 2.0.0
  - theming: 1.9.0
  - twofactor_backupcodes: 1.7.0
  - updatenotification: 1.8.0
  - viewer: 1.2.0
  - workflowengine: 2.0.0
Disabled:
  - admin_audit
  - encryption
  - files_external
  - user_ldap

Nextcloud configuration:

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "roma2.sineo.it"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "18.0.6.0",
        "overwrite.cli.url": "https:\/\/roma2.sineo.it\/nextcloud",
        "htaccess.RewriteBase": "\/nextcloud",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "loglevel": 2,
        "maintenance": false,
        "theme": ""
    }
}

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

hrk avatar Jul 09 '20 12:07 hrk

Screenshots of the bug https://imgur.com/a/nPp6bma

hrk avatar Jul 09 '20 12:07 hrk

FWIW: I inspected the code and the issue lies in the imported library markdown-it-task-lists which, unfortunately, seems to be abandoned. There is an issue (https://github.com/revin/markdown-it-task-lists/issues/27) w/ an (unproper) pull request (https://github.com/revin/markdown-it-task-lists/pull/29). The issue has been closed by the reporter due to the abandoned status of the library, claiming that there's another library handling it correctly (https://github.com/linsir/markdown-it-task-checkbox). This library is available in NPM too (https://www.npmjs.com/package/markdown-it-task-checkbox).

hrk avatar Jul 12 '20 08:07 hrk

FWIW, maybe the best approach would be dropping markdown-it altogether and move to Nextcloud Text engine? https://nextcloud.com/blog/nextcloud-introduces-collaborative-rich-text-editor/

The Nextcloud Notes app is doing the same (https://github.com/nextcloud/notes/issues/331)

hrk avatar Jul 15 '20 10:07 hrk

That is the plan actually, yes :grin:

See #1663

juliusknorr avatar Jul 15 '20 10:07 juliusknorr

Thank you very much :)

hrk avatar Jul 15 '20 11:07 hrk

@juliushaertl Phew! I was just browsing Issues to see if I needed to report another one with Checklists in Descriptions.

Namely, if a grave accent (aka backtick) is used to emphasize code in a checklist item, everything before that character is repeated in View mode. It's not repeated when you switch back to Edit mode.

For example, this in Edit mode:

  • [ ] File bug report with NC Deck over rendered word repetition before code markdown delimiter

Renders like this in View mode:

  • [ ] File bug report with NC Deck over rendered word repetition before code File bug report with NC Deck over rendered word repetition before code markdown delimiter

floogy avatar Nov 11 '20 15:11 floogy

Are there any news on this? The pull request to use the NC text app was closed due to lack of time.

Is there a chance that the move to https://github.com/linsir/markdown-it-task-checkbox as written by @hrk takes less effort but fixes it quickly?

q-wertz avatar Apr 11 '22 14:04 q-wertz