-
Notifications
You must be signed in to change notification settings - Fork 134
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
Implements parsing and repairing formatted ascii tables #37
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Updating my base fork
Added line breaks and tabs to HTML output so the results are a bit easier to read in the output textarea.
First pass at implementing @rhys0178 cookie saving. Haven't got it working locally yet, and I'd like to save/load the parameters to the cookie too before committing this to the main branch.
The output auto-populates, so swapped the "Create" button out for a "Reset" button that would clear user preferences and reload the default.
ReStructuredText Grid format uses a different separator for the top and bottom of the header, the assumption has been that the header top and bottom are the same when both are present. A more robust solution could be to define headerTop, headerBottom, and bodyBottom horizontal character definitions for each style. Reddit has no left or right side lines, but has vertical separators in the middle, which was also new. A more robust solution could be to define headerLeft, headerRight, bodyLeft, and bodyRight vertical character definitions for each style.
Reverting to master
ReStructuredText Grid format uses a different separator for the top and bottom of the header, the assumption has been that the header top and bottom are the same when both are present. A more robust solution could be to define headerTop, headerBottom, and bodyBottom horizontal character definitions for each style. Reddit has no left or right side lines, but has vertical separators in the middle, which was also new. A more robust solution could be to define headerLeft, headerRight, bodyLeft, and bodyRight vertical character definitions for each style.
… table into code. Pulled out the separator line generator to its own function to reduce redundant code. Added map of the border style variables in script.js for reference.
Some styles over-ride the prefix/suffix (wikimedia, specifically). Moved prefix definition earlier to allow border style to null out the prefix/suffix.
Dude, I'm blindly merging your two PR. There are so much changes it's practically impossible to review. Pro tip for future PR on any project : please be more atomic, ie a PR for cookie implementation, a PR for tweaking style, and so on. |
Cannot merge actually, script.js is conflicting |
Sorry about that, guess I got a little carried away. :-) I'll close the request and resubmit more sensically. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements parsing and repairing formatted ascii tables (#31 and #33), user can select the input style, or use "attempt auto-detect" to try and guess the input style, it seems to work pretty well for the test cases I tried. This successfully repairs the test case described in #31. You can output in the same format, or convert to any of the other output formats, with or without the header option.
Effects on the items from pull request #36:
Contains Prefix option for output RE: #35, but the comment prefixes are not compatible with input style options yet, if that's even a desired feature.
Supports output to reStructuredText Grid style RE: #32, simple tables can be parsed successfully to convert table formats, but the input parser still chokes on the multi-row spanning table example: