Skip to content

Markdown files from external editors lose formatting on save #593

@inthreedee

Description

@inthreedee

Summary
Markdown files that are created in external markdown and text apps will have their formatting completely overridden and/or lost when edited through the Nextcloud web interface. Newlines, tabs, and spaces are thrown out everywhere in the document--not just on the edited line--and lists will be changed to asterisks instead of dashes. See screenshots below.

Background
I use external text editors for my markdown files and then sync them to my Nexctloud. I primarly use Atom for its markdown support but will also use basic text editors like Gedit on Linux or Notepad on Windows. That's the great thing about markdown files, after all, they're just plain text. When I edit these files through my Nextcloud web interface, the formatting of the entire file is destroyed.

Related: #390

To Reproduce
Steps to reproduce the behavior:

  1. Create a markdown file in an external editor such as Atom/Gedit or a basic text editor like Notepad
  2. Add some spaces, tabs, newlines, lists, etc.
  3. Open the markdown file in the Nextcloud web editor and notice the formatting differences
  4. Make a minor edit to the file in the Nextcloud web interface
  5. View the file again in your external editor and notice the formatted has been destroyed.

Expected behavior
I expect the Text app to not completely destroy any formatting created by external apps. If any special formatting is unsupported, it should be left alone for maximum compatibility with external apps. If any formatting changes must be made based on the current edits, those changes should apply ONLY to the current edits and not the entire file.

Screenshots

How it looks in Gedit under Linux:
Screenshot from 2020-01-19 17-02-41

How it looks when opened in my Nextcloud web interface:
Screenshot from 2020-01-22 17-04-36

Make an edit through the web interface and now the file's formatting has been destroyed when viewed in Gedit:
Screenshot from 2020-01-19 17-12-49

Client details:

  • OS: Arch Linux
  • Browser: Firefox
  • Version: 72.0.1
  • Device: desktop
Server details

Text app version: 1.1.1

Operating system: Ubuntu 18.04.3

Web server: Apache

Database: Mysql 5.7.29

PHP version: 7.3.13

Nextcloud version: 17.0.2

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions