Skip to content

Commit

Permalink
move regex back up
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherChudzicki committed Jan 24, 2022
1 parent 64bfc9a commit f22526a
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions static/js/lib/ckeditor/plugins/ResourceLinkMarkdownSyntax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ import {
RESOURCE_LINK
} from "@mitodl/ckeditor5-resource-link/src/constants"

export const RESOURCE_LINK_SHORTCODE_REGEX = /{{< resource_link (\S+) "(.*?)" >}}/g
/**
* (\S+) to match and capture the UUID
* "(.*?)" to match and capture the label text
*
* Limitations:
* - gets fooled by label texts that include literal `" >}}` values. For
* example, < resource_link uuid123 "silly " >}} link" >}}.
*/

/**
* Class for defining Markdown conversion rules for Resource links
*
Expand All @@ -25,17 +35,6 @@ import {
* The ResourceEmbed plugin itself is provided via our fork of CKEditor's
* 'link' plugin.
*/

export const RESOURCE_LINK_SHORTCODE_REGEX = /{{< resource_link (\S+) "(.*?)" >}}/g
/**
* (\S+) to match and capture the UUID
* "(.*?)" to match and capture the label text
*
* Limitations:
* - gets fooled by label texts that include literal `" >}}` values. For
* example, < resource_link uuid123 "silly " >}} link" >}}.
*/

export default class ResourceLinkMarkdownSyntax extends MarkdownSyntaxPlugin {
constructor(editor: editor.Editor) {
super(editor)
Expand Down

0 comments on commit f22526a

Please sign in to comment.