The changes in 8599bfcaff needed to be applied precisely in-step with the core changes from https://github.com/discourse/discourse/pull/23148. This is impossible to guarantee with a theme - `.discourse-compatibility` does not give us enough precision. So instead, we need some temporary backwards-compatibility shims so that the new relative-import paths still work on old discourse.
We were relying on the `event.target`, and sometimes that target was not the button element with the `table-id` data attribute, but the svg.
This commit makes a few changes:
- renames `tableId` to `tableIndex`
- passes the index as part of the attributes to the `generateModal` function
Pasting text with linebreaks into the table UI results in incorrectly
generated table markdown.
This fix strips linebreaks from text during table markdown generation.
Previously, the regex was catching uploads as well as tables.
This change ensures only strict tables are matched by requiring that
matches start with the pipe character.
Also adds a unit test for `findTableRegex` to describe the expected
behaviour of the helper.
Now that all of our singletons have been converted to true Ember Services, we can remove our custom `discourse/component/glimmer` superclass and use explicit injection
* DEV: Use alternate fork of `array-to-table`
* DEV: Add unit test for `arrayToTable()` method
* Move `arrayToTable` so it is available for unit tests
* DEV: Add assertion for creating a markdown table with special chars
When a table with special characters (such as `$`) is inserted in a cell to the right of a blank cell. The alignment of the table gets ruined if the table doesn't have surrounding pipes. This check ensures this alignment is correct.
Co-authored-by: Penar Musaraj <[email protected]>
* UX: Wrap words instead of dynamic widths and align left
* UX: Improve sticky header on scroll
* DEV: Convert default column text to localizable strings