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

Add script to fix markdown table formatting #2

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

Conversation

wanLo
Copy link
Member

@wanLo wanLo commented Mar 6, 2019

A Python script that takes XWiki-Markdown 1.2 code and corrects formatting issues within tables by clearing out line breaks that harm the table layout

@marcelklehr
Copy link
Member

marcelklehr commented Mar 6, 2019

Looks good.

What happens if I input

|-|-|-|
|foo|

bar after some line breaks|alright|
|bla|bla|bla|

Does this occur at all (cells starting with line breaks)? Probably not that important though 🤷‍♂️

Copy link
Contributor

@zonradkuse zonradkuse left a comment

Choose a reason for hiding this comment

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

👍

md_format_tables.py Outdated Show resolved Hide resolved
md_format_tables.py Outdated Show resolved Hide resolved
@wanLo
Copy link
Member Author

wanLo commented Mar 7, 2019

Does this occur at all (cells starting with line breaks)? Probably not that important though man_shrugging

Thought about counting the occurrences of | in the (non-broken) table header. But taking a closer look, this doesn't happen at all - cell borders and cell content ar always separated with white space. Tables broken to this extend wouldn't be this easy to fix automatically.

@marcelklehr
Copy link
Member

So this script will be run on wiki pages that are still in markdown only? How many of those are there? I was under the impression the majority was already converted.

@zonradkuse
Copy link
Contributor

Unfortunately, the contrary is true. Most pages are not converted. Only those which were edited by some member before and probably not even here all were converted.

@marcelklehr
Copy link
Member

Ok, so part of the link-migration process is

  1. Fix markdown tables
  2. Convert everything to xwiki syntax
  3. Migrate linked documents

?

@zonradkuse
Copy link
Contributor

We should swap step 2 and 3 in order to make sure nothing weird happens to the links during conversion. But besides that, this is the gameplan.

@wanLo wanLo force-pushed the master branch 2 times, most recently from cfde4b6 to 32dea1e Compare April 27, 2019 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants