Skip to content

fix: allow to override h1 to h6 through discovered components#2

Merged
thetutlage merged 3 commits into
edge-js:1.xfrom
Xstoudi:fix/custom-hx
Jun 1, 2026
Merged

fix: allow to override h1 to h6 through discovered components#2
thetutlage merged 3 commits into
edge-js:1.xfrom
Xstoudi:fix/custom-hx

Conversation

@Xstoudi
Copy link
Copy Markdown
Contributor

@Xstoudi Xstoudi commented May 9, 2026

🔗 Linked issue

#1

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

dashCase is not what's needed there, we just want to replace _ with - as-is. Let me know if you'd prefer an other way to allow package users to override h2 node by loading h2.edge component. Without the change, dash casing load h2.edge as h-2, meaning it will never be used to replace ## title in markdown.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@thetutlage
Copy link
Copy Markdown
Member

The issue is, what if the filename on the disk is saved as camelCase or PascalCase?

@Xstoudi
Copy link
Copy Markdown
Contributor Author

Xstoudi commented May 31, 2026

Thanks for your answer. I usually avoid camelCase/PascalCase filenames, so I hadn't considered that case.
Would you prefer keeping dashCase() for general component discovery and handling h1-h6 specially? I'll propose a change in that sense tonight. Do you have a different approach in mind to fix this overriding of markdown?

@thetutlage
Copy link
Copy Markdown
Member

Yeah, our string utilities are bad with converting properties that contains numbers or dots. So we can be selective about html elements with numbers like headings

@Xstoudi
Copy link
Copy Markdown
Contributor Author

Xstoudi commented May 31, 2026

I handle titles as specific cases, I didn't find any other html tag that uses number and I could have missed something, but I guess it won't be relevant anyway regarding markdown override. Let me know if something more is required, thanks for the review!

@thetutlage thetutlage merged commit 16d738d into edge-js:1.x Jun 1, 2026
5 checks passed
@thetutlage
Copy link
Copy Markdown
Member

👍🏽

@Xstoudi Xstoudi deleted the fix/custom-hx branch June 1, 2026 08:48
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