Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useSemanticLists #9

Open
mlewand opened this issue Mar 26, 2015 · 0 comments
Open

useSemanticLists #9

mlewand opened this issue Mar 26, 2015 · 0 comments

Comments

@mlewand
Copy link
Contributor

mlewand commented Mar 26, 2015

New Assessment

Base Information

This is somehow covered by the documentVisualListsAreMarkedUp, but it's more complex. It might either replace documentVisualListsAreMarkedUp or be implemented within it. We shouldn't keep two similar assessments.

Rationale: In CKE we're working with HTML, so we should prefer semantic markup over plain text. Sometimes end-users tries to mimic list a with plain text.

Testability: 0.5

Techniques:

Implementation

We would need to take care of both ordered, and unordered lists.

  1. "ordered lists"
    1. Find all sectioning elements (or paragraph or whatever).
    2. Get its innerText (or textContent in FF, but then it does not convert br to new line).
    3. Perform a regexp that will look for strings like: 1) foo \n+ 2, bar.
  2. "unordered lists" - we must remember that someone might use <img> as bullets, followed by whitespace (possibly &nbsp;).
    1. Find all sectioning elements (or paragraph or whatever).
    2. Check if the first childElement is an img element (preferably decorative image - so empty or missing alt attr).
    3. Check if next sectioning element begins with img with the same src attribute.

Real World Examples

Quick Fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant