-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cacc6af
commit cc0f5d6
Showing
6 changed files
with
24 additions
and
70 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,11 @@ | ||
import { getConfig } from '@edx/frontend-platform'; | ||
|
||
import { STYLE_TAG_PATTERN } from './constants'; | ||
|
||
/** | ||
* Extracts content of <style> tags from the given HTML string. | ||
* @param {string} htmlString - The HTML string to extract styles from. | ||
* @returns {string[]} An array containing the content of <style> tags. | ||
*/ | ||
export function extractStylesWithContent(htmlString) { | ||
const matches = []; | ||
let match = STYLE_TAG_PATTERN.exec(htmlString); | ||
|
||
while (match !== null) { | ||
matches.push(match[1]); // Pushing content of <style> tag | ||
match = STYLE_TAG_PATTERN.exec(htmlString); | ||
} | ||
|
||
return matches; | ||
} | ||
|
||
/** | ||
* Retrieves the base path for XBlock actions. | ||
* @param {string} xblockId - The ID of the XBlock. | ||
* @returns {string} The base path for XBlock actions. | ||
*/ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export function getXBlockActionsBasePath(xblockId) { | ||
return `${getConfig().STUDIO_BASE_URL}/xblock/${xblockId}/actions`; | ||
} |
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
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
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