Skip to content

Commit

Permalink
Merge pull request #1169 from nataliauvarova/kalmyk_markup
Browse files Browse the repository at this point in the history
Kalmyk markup: delete unnecessary
  • Loading branch information
nataliauvarova authored Dec 18, 2024
2 parents eeefa4c + ba5d3c2 commit 858e88a
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions src/components/LexicalEntryCorp/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,9 @@ const TextEntityContent = ({
}

// if not "edit" mode. We can not simply check for mode value because of useEffect and EventListener specific
/* new!!!!! */
/*if (startContainer.parentElement.parentElement?.classList[0] !== "lingvo-input-buttons-group__name") {
return null;
}*/
if (startContainer.parentElement.parentElement.parentElement?.classList[0] !== "lingvo-input-buttons-group__name") {
return null;
}
/* /new!!!!! */

if (getCurrentArea().contains(startContainer)) {
return {
Expand Down Expand Up @@ -323,24 +318,18 @@ const TextEntityContent = ({
const metatext = new RegExp([pg_ln, pg, ln, snt, missed].map(regex => regex.source).join("|"), "g");

const highlights = [];
const highlightsMarkup = []; // new!!!!!
const highlightsMarkup = [];

for (const [indexes, ..._] of markups) {
if (!indexes || indexes.length !== 2) {
continue;
}
const [startMarkup, endMarkup] = indexes;

/* new!!!! */
highlightsMarkup.push({
start: startMarkup,
length: endMarkup - startMarkup
});
/*highlights.push({
start: startMarkup,
length: endMarkup - startMarkup
});*/
/* /new!!!! */
}

let segment;
Expand All @@ -364,7 +353,6 @@ const TextEntityContent = ({
>
{!(is_being_updated || edit) && (
<span className="lingvo-input-buttons-group__name">
{/* new!!!! */}
<RangesMarker
mark={highlights}
options={{
Expand All @@ -380,8 +368,6 @@ const TextEntityContent = ({
{text}
</RangesMarker>
</RangesMarker>
{/*<RangesMarker mark={highlights}>{text}</RangesMarker>*/}
{/* /new!!!! */}
</span>
)}
{(is_being_updated || edit) && (
Expand Down Expand Up @@ -478,7 +464,6 @@ const TextEntityContent = ({
</span>
) : (
<span className="lingvo-entry-content">
{/* new!!!! */}
<RangesMarker
mark={highlights}
options={{
Expand All @@ -494,8 +479,6 @@ const TextEntityContent = ({
{text}
</RangesMarker>
</RangesMarker>
{/*<RangesMarker mark={highlights}>{text}</RangesMarker>*/}
{/* /new!!!! */}
</span>
)}
<Checkbox
Expand Down Expand Up @@ -523,7 +506,6 @@ const TextEntityContent = ({
case "view":
return (
<span className="lingvo-entry-content">
{/* new!!!! */}
<RangesMarker
mark={highlights}
options={{
Expand All @@ -539,14 +521,11 @@ const TextEntityContent = ({
{text}
</RangesMarker>
</RangesMarker>
{/*<RangesMarker mark={highlights}>{text}</RangesMarker>*/}
{/* /new!!!! */}
</span>
);
case "contributions":
return entity.accepted ? (
<span className="lingvo-entry-content">
{/* new!!!! */}
<RangesMarker
mark={highlights}
options={{
Expand All @@ -562,8 +541,6 @@ const TextEntityContent = ({
{text}
</RangesMarker>
</RangesMarker>
{/*<RangesMarker mark={highlights}>{text}</RangesMarker>*/}
{/* /new!!!! */}
</span>
) : (
<Button.Group basic icon className="lingvo-buttons-group">
Expand Down

0 comments on commit 858e88a

Please sign in to comment.