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

Some questions are indented in list #242

Open
rgaudin opened this issue Sep 4, 2021 · 4 comments
Open

Some questions are indented in list #242

rgaudin opened this issue Sep 4, 2021 · 4 comments
Assignees
Labels
Milestone

Comments

@rgaudin
Copy link
Member

rgaudin commented Sep 4, 2021

For some reason, there are questions that are indented in questions list (here on page 100)

https://dev.library.kiwix.org/stackoverflow_en_nopic_2021-08/questions_page=100

Screen Shot 2021-09-04 at 15 05 00

@IMayBeABitShy
Copy link
Contributor

This seems to be caused by missing/faulty html escaping of the question excerpt in the list. The question in question (pun intended) starts with the following text:

I try to check a radio button with jQuery. Here's my code:

<form>
    <div id='type'>
        <input type='radio' id='radio_1' name='type' value='1' />
        <input type='radio' id='radio_2' name='type' value='2' />
        <input type='radio' id='radio_3' name='type' value='3' /> 
    </div>
</form>

The excerpt seems to end in such a way that the closing tag for the div (as well as the closing tag for the form) is cut off, resulting in the following HTML code:

<div class="summary">
        
        <h3><a href="./questions/5665915/how-to-check-a-radio-button-with-jquery" class="question-hyperlink">How to check a radio button with jQuery?</a></h3>
        <div class="excerpt">I try to check a radio button with jQuery. Here's my code:
<form>
    <div id='type'>
        <input type='radio' id='radio_1' name='type' value='1' />
        <input type='radio' id='radio_2' name='type' value='2' />
        <input type='radio'</div>
        <div class="grid ai-start jc-space-between fw-wrap">
            <div class="grid gs4 fw-wrap tags ">

This causes the closing div tag that is supposed to close the div of the excerpt to instead close the div of the contained code. This leads to a cascade of div mismatches, which ultimately cause all following questions to become a child of said question. It also messes up the overall HTML structure of the page.

Proposed solution: Escape/bleach the question excerpt in sotoki/templates/question_list_item.html.

@stale
Copy link

stale bot commented Mar 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@stale stale bot added the stale label Mar 2, 2022
@kelson42 kelson42 added this to the 2.1.0 milestone May 26, 2022
@stale stale bot removed the stale label May 26, 2022
@stale
Copy link

stale bot commented Aug 13, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@stale stale bot added the stale label Aug 13, 2022
@kelson42 kelson42 modified the milestones: 2.1.0, 2.2.0 Oct 24, 2022
@stale stale bot removed stale labels Oct 24, 2022
@stale
Copy link

stale bot commented May 26, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@stale stale bot added the stale label May 26, 2023
@benoit74 benoit74 modified the milestones: 2.1.0, 2.2.0 Mar 27, 2024
@stale stale bot removed the stale label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants