FIX: Special character alignment issue (#10)

* 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]>
This commit is contained in:
Keegan George
2022-08-11 11:33:34 -07:00
committed by GitHub
co-authored by Penar Musaraj
parent dacdd1cc4e
commit 7b37c6acc1
6 changed files with 74 additions and 15 deletions
@@ -9,7 +9,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
import Session from "discourse/models/session";
import loadScript from "discourse/lib/load-script";
import PrettyText, { buildOptions } from "pretty-text/pretty-text";
import { tokenRange } from "../lib/utilities";
import { tokenRange } from "../discourse-table-builder/lib/utilities";
export default apiInitializer("0.11.1", (api) => {
const site = api.container.lookup("site:main"),
siteSettings = api.container.lookup("site-settings:main");