Skip to content

Commit

Permalink
Tweak presentation of errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
liffiton committed Dec 16, 2024
1 parent 0e5248d commit 716ce0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/language/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def insert_corrections_html(original: str, errors: list[ErrorSet]) -> str:

def replacement(match: re.Match[str]) -> str:
matched_text = match.group(0)
error_types = "".join(f'<span class="item">{item}</span>' for item in error_mapping[matched_text])
error_types = "".join(f'<span class="item">- {item}</span>' for item in error_mapping[matched_text])
return f'<span class="writing_error" tabindex="0">{matched_text}<span class="is-size-6 writing_error_details">{error_types}</span></span>'

# Replace matches with wrapped spans
Expand Down
6 changes: 2 additions & 4 deletions src/language/templates/help_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
top: 120%;
left: 1em;
z-index: 100;
border: 2px solid #fda;
width: max-content;
border: 2px solid #ec9;
background: #fec;
box-shadow: 3px 4px 8px 2px #0003;
padding: 0.25em 0.5em;
Expand All @@ -31,9 +32,6 @@
display: block;
font-size: 120%;
}
.writing_error .writing_error_details .item:before {
content: "- ";
}
.writing_error:hover, .writing_error:focus {
background: #fda5;
border-radius: 5px;
Expand Down

0 comments on commit 716ce0f

Please sign in to comment.