Skip to content

Reduce markdown preview height to exact rendered size #7187

Closed

Description

@pgimalac

Description

Github has a bug where when a markdown input's height is bigger than the rendered text, the preview tab will not be reduced to the exact size, resulting in a lot of empty space at the bottom.

This is a Github issue, but exacerbated when the fit-textareas feature is enabled, so I wasn't sure whether this would fit this project, and if so if it should be part of fit-textareas or be its own new feature (but considering it's not really about a textarea it might not really belong in fit-textareas).

Note that I locally implemented a fix for this issue, by removing the size style on the preview div when the preview button is clicked. Let me know if you think this can be part of this project.

Example URLs

I don't have an URL, it applies to any markdown input field with preview tab, in order to reproduce you can just insert empty lines in your markdown input.

A less contrived example is when there are html comments (which are not rendered) in the input, it easily makes the input much bigger than the rendered format.

Input Original With fix
image image image

Activity

  1. added
    small
    and removed on Dec 27, 2023
  2. fregante commented on Dec 27, 2023

    @fregante
    Member

    100% right about this one. It can go in GitHub-bugs.css

  3. pgimalac commented on Dec 27, 2023

    @pgimalac
    ContributorAuthor

    Nice, the fix is actually much cleaner directly from the CSS !
    I'll open a PR tonight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedenhancementsmall

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions