Git Merge Request #277: Added checklist support #8085 (merged)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

Shalitha Suranga wants to merge 12 commits from /u/shalithasuranga/allura/ to master, 2018-09-14

I have added checklist support [#8085] and these files are changed

requirements.txt - added markdown checklist extension
app_globals.py - added markdown extension to ext array

How sub issues were solved

short reference links are affecting and instead checklist there were links. Thus I modified
markdownextensions.py's ForgeLink Pattern

checkbox was not rendered to do sanitize function. Therefore I commented input element from blacklist of util.py

Please review and suggest your ideas

Commit Date  
[2157a2] (checkbox-issue) by Shalitha Shalitha

Update docs for checklist support

2018-09-11 17:02:56 Tree
[f44a16] by Shalitha Shalitha

Add test for checkbox rendering

2018-09-11 16:47:04 Tree
[4c9130] by Shalitha Shalitha

Add comment

2018-09-10 17:07:39 Tree
[414c56] by Shalitha Shalitha

Ignore only checkboxes from sanitization

2018-09-10 17:06:31 Tree
[0ea777] by Shalitha Shalitha

Add comment

2018-09-10 15:33:52 Tree
[1e524b] by Shalitha Shalitha

Remove parantheses

2018-09-10 15:32:11 Tree
[9a8fae] by Shalitha Shalitha

Reset regex and ignore checklists

2018-09-06 17:24:59 Tree
[08b567] by Shalitha Shalitha

Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/allura into checkbox-issue

2018-09-05 16:37:39 Tree
[f64bab] by Shalitha Shalitha

Remove input from blacklist

2018-09-02 14:12:23 Tree
[d77372] by Shalitha Shalitha

Use custom regex for short links

2018-09-02 14:11:46 Tree
[da7aee] by Shalitha Shalitha

Add extension to array

2018-09-02 14:08:58 Tree
[bd2a05] by Shalitha Shalitha

Add markdown extension

2018-09-02 14:04:21 Tree

Discussion

  • Dave Brondsema

    Dave Brondsema - 2018-09-10

    Hi, thanks for this! It's pretty nice improvement. As a new feature though, there is some improvements & changes to do:

    It would be good to add a test for this specifically.

    The allura.tests.test_utils.TestHTMLSanitizer.test_html_sanitizer_form_elements test is failing. You could just update the test to reflect the fact that <input> tags are displayed now. But I think it would be best of only the checkboxes were allowed and other input types were still sanitized. I think you could do this by uncommenting (ns_html, 'input'), again and then in def sanitize_token after it does some very specific checking for iframes, add some specific checking for input tags. I'm thinking if it is an input and type is checkbox then allow it, but don't allow other types (text, radio, submit, etc). And it's just a single tag so that should make the code simpler than the iframe check (you won't have to deal with "EndTag" and tracking anything like _prev_token_was_ok_iframe hopefully)

    if(el.text == 'x' or el.text == ' '): doesn't need the parenthesis - that will make it look a little nicer and match PEP8 guidelines. Also I would suggest adding a comment here. So someone later can know that these lines are for checklists to work (otherwise its not very obvious what they are doing).

    The markdown help page should be updated to mention this new feature.

    Have you looked into making the checkboxes interactive if you have edit permissions? It looks like the markdown-checklist package has some helper JS for it, but would take custom code to handle the ajax and do the update. Don't to do this now, but it would be nice later of course.

     
  • Hi... Dave

    Thank you for the guidance. Yeah it was easy with sanitize token. I did those changes now..I will push commits by adding unit test for this improvement

     
  • Hi.. Dave

    I have made these changes and pushed to marge request

    • Fix if condition parantheses and placing a comment
    • allow only input type checkbox using sanitized token approach
    • Create test case for sanitizer allura.tests.test_utils.TestHTMLSanitizer.test_html_sanitizer_checkbox
    • Updating List documentation

    Please review and advice next steps

    Thanks

     
  • Dave Brondsema

    Dave Brondsema - 2018-09-13
    • Status: open --> merged
     
  • Dave Brondsema

    Dave Brondsema - 2018-09-13

    Looks good, thanks!

     
    • Thanks for merging .. welcome

       

Log in to post a comment.