quasar-ui-danx 0.4.23 → 0.4.24

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quasar-ui-danx",
3
- "version": "0.4.23",
3
+ "version": "0.4.24",
4
4
  "author": "Dan <dan@flytedesk.com>",
5
5
  "description": "DanX Vue / Quasar component library",
6
6
  "license": "MIT",
@@ -376,7 +376,7 @@ export function parseMarkdownYAML(string: string): object | null | false {
376
376
  * Parse a markdown formatted string and return the code block content
377
377
  */
378
378
  export function parseMarkdownCode(string: string): string {
379
- return string.replace(/^```[a-z0-9]{1,6}\s/, "").replace(/```$/, "");
379
+ return string.replace(/^```[a-z0-9]{0,6}\s/, "").replace(/```$/, "");
380
380
  }
381
381
 
382
382
  /**
@@ -384,6 +384,7 @@ export function parseMarkdownCode(string: string): string {
384
384
  * ie: a valid JSON string with a ```json prefix and ``` postfix
385
385
  */
386
386
  export function fMarkdownCode(type: string, string: string | object): string {
387
+ console.log("formatting", type, string);
387
388
  if (typeof string === "object" || isJSON(string)) {
388
389
  switch (type) {
389
390
  case "yaml":
@@ -396,7 +397,9 @@ export function fMarkdownCode(type: string, string: string | object): string {
396
397
  }
397
398
 
398
399
  const regex = new RegExp(`\`\`\`${type}`, "g");
399
- if (!((string || "") as string).match(regex)) {
400
+ string = (string || "") as string;
401
+ if (!string.match(regex)) {
402
+ string = parseMarkdownCode(string as string);
400
403
  return `\`\`\`${type}\n${string}\n\`\`\``;
401
404
  }
402
405