Skip to content

modify or replace OverType #99

@nedtwigg

Description

@nedtwigg

We are currently using the OverType library for syntax highlighting. Our biggest problem with it is that we are using it to modify text areas, but it's really built to create them. We're working against its nature in lots of places.

For example, right now we don't / can't enhance text areas by default, we only enhance very specific ones that we have targeted. This is because when we enhance a text area, we clobber its styling, and we have to manually put it all back how it was:

const overtype = new OverType(overtypeContainer, {
...commonGitHubOptions,
minHeight: "102px",
padding: "var(--base-size-8)",
placeholder: "Add your comment here...",

Also, whatever method it uses to listen for changes doesn't always work. For example, when images get dragged on to the GitHub textarea, the preview unsyncs briefly, but this can fix it:

const listenForEmpty = new MutationObserver(() => {
if (textArea.value === "") {
overtype.updatePreview()
}
})
listenForEmpty.observe(textArea, { attributes: true, characterData: true })

Changes we have made:

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions