fix(p-as-heading): p-as-heading rule to account for textContent length#3145
fix(p-as-heading): p-as-heading rule to account for textContent length#3145
p-as-heading rule to account for textContent length#3145Conversation
|
@WilcoFiers we had questions on this requirement:
There's a gap in the algorithm, like what happens if it's more than twice as long but not greater than the length. Could you give a bit more clarification? Here's what I have reading that description: const headingLength = headingEl.textContent.length;
const paragraphLength = pEl.textContext.length;
if (headingLength > paragraphLength) {
return true;
}
else if (headingLength < paragraphLength / 2) {
return false;
}
else {
return undefined;
} |
|
@straker I think your dummy code is pretty much how I think of it. We should probably put in options to make these values configurable. Beyond that, these seem like reasonable heuristics for this rule. |
@WilcoFiers Could you provide a bit more info on configurable by options? |
WilcoFiers
left a comment
There was a problem hiding this comment.
One comment, rest looks good.
p-as-heading rule to account for textContent lengthp-as-heading rule to account for textContent length
Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
Ref: #3130