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

added headings support #49

Merged
merged 1 commit into from
Jun 21, 2024
Merged

added headings support #49

merged 1 commit into from
Jun 21, 2024

Conversation

x1xo
Copy link
Contributor

@x1xo x1xo commented Jun 21, 2024

Summary by Sourcery

This pull request introduces support for headings in the text parser, allowing for H1, H2, and H3 levels. It also includes new CSS classes to style these headings appropriately.

  • New Features:
    • Added support for headings in the text parser, including H1, H2, and H3 levels.
  • Enhancements:
    • Introduced new CSS classes for headings (heading1, heading2, heading3) with specific font sizes and bold styling.

Copy link

sourcery-ai bot commented Jun 21, 2024

Reviewer's Guide by Sourcery

This pull request adds support for markdown-style headings. The changes include adding new CSS classes for different heading levels in 'assets/css/index.css' and updating the JavaScript in 'assets/js/script.js' to replace markdown-style headings with the appropriate HTML tags.

File-Level Changes

Files Changes
assets/css/index.css
assets/js/script.js
Implemented support for markdown-style headings by adding corresponding CSS classes and JavaScript regex replacements.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @x1xo - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -439,6 +439,10 @@ addEventListener('DOMContentLoaded', () => {
.replace(/__(.+?)__/g, '<u>$1</u>')
.replace(/\*(.+?)\*/g, '<em>$1</em>')
.replace(/_(.+?)_/g, '<em>$1</em>')
//headings
.replace(/^# (.*)$/gm, '<h1 class="heading1">$1</h1>')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): Consider escaping special characters in heading content.

Escaping special characters in the heading content can help prevent potential XSS vulnerabilities.

@Glitchii Glitchii merged commit 4bc5519 into Glitchii:main Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants