Skip to content

Commit deef450

Browse files
committed
edit function documentation to add clarity
1 parent 51f0f99 commit deef450

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

packages/js/src/decorator/tinyMCE.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ function markTinyMCE( editor, paper, marks ) {
4545
// Generate marked HTML.
4646
forEach( marks, function( mark ) {
4747
/*
48-
* Classic editor uses double quotes for HTML attribute values. However, in `yoastseo`, we use single quotes for the attribute values
49-
* when we create the marked object. As a result, the replacement did not work, as the marks passed by `yoastseo` did not match anything
50-
* in the original text. This step is replacing the single quotes in the marked object output by `yoastseo` with double quotes.
48+
* Classic editor uses double quotes for HTML attribute values. However, Block editor uses single quotes for HTML tag attributes,
49+
* and that's why in `yoastseo`, we use single quotes for the attribute values when we create the marked object. As a result,
50+
* the replacement did not work, as the marks passed by `yoastseo` did not match anything in the original text.
51+
* This step is replacing the single quotes in the marked object output by `yoastseo` with double quotes.
5152
* This way, we make sure that the replacement can find a match between the original text of the marked object and the text in the page.
5253
*/
5354
mark._properties.marked = languageProcessing.replaceSingleQuotesInTags( mark._properties.marked );

packages/yoastseo/src/languageProcessing/helpers/word/markWordsInSentences.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const anchorDeconstructionRegex = /(<a[\s]+[^>]+>)(.+?)(<\/a>)/;
1717
* @returns {object} An object containing the opening tag and the content.
1818
*/
1919
export const deConstructAnchor = function( anchor ) {
20+
// The const array mirrors the anchorDeconstructionRegex, using a comma to access the first element without a name.
2021
const [ , openTag, content ] = anchor.match( anchorDeconstructionRegex );
2122
return {
2223
openTag: openTag,

0 commit comments

Comments
 (0)