Giter Site home page Giter Site logo

markdown-live-preview's Introduction

Markdown Live Preview

Markdown Live Preview is a tiny web tool to preview Markdown formatted text.

Setup

$ make setup

Build

$ make build

Run local testing server

$ make run

This script requires Python 3.

License

See the LICENSE file in this repo.

markdown-live-preview's People

Contributors

tanabe avatar jeffersonlam avatar mathisto avatar

Stargazers

Mo Beigi avatar  avatar Augustus Chen avatar wandergis avatar Shreethaar Arunagirinathan avatar Max Beier avatar βασίλης avatar tyr898 avatar Master Games avatar Mohit Rathore avatar Omarsx1 avatar  avatar  avatar Akmal avatar 4honor avatar Jon avatar six-6 avatar Kovalski avatar Kuma Telila avatar  avatar Erdack54 avatar Yoseph avatar samma avatar Skander Ben Alaya avatar  avatar Matt avatar  avatar  avatar  avatar Sandeepin avatar  avatar David avatar LIGMATV avatar b4rtolom3o avatar  avatar Liam Lage avatar Stephen Paul Hassall avatar Anthony avatar TsukiSama9292 avatar Dimitrios Kioroglou avatar Vitali Slepnyov avatar  avatar Cody Gagnon avatar amotivv, inc. avatar  avatar Red avatar Patrick O'Keeffe avatar Tyler Warner avatar Lucas Zarandón avatar  avatar Ayush Somani avatar Anna Savina avatar Stephan Randle avatar Elison Rissatto avatar Idris Olubisi avatar Silas Yu avatar firetop001 avatar ksyang avatar chadah avatar Stephen Flynn avatar Ahmet Eren Odacı avatar Aseer avatar uri avatar John Kennedy Haringa Peña avatar LionelVanArk avatar Lahn avatar Maarten van Bree avatar Khenzii avatar Rabbit avatar Jay Nath avatar Julián Markow avatar Ezequiel Dev avatar  avatar John Ballinger avatar Jerome Dh avatar Viyan.UX Engineer avatar Aaditya avatar  avatar Sunao Hara avatar Abhinav avatar Dhruv avatar Valerii Savchenko avatar João Alexandre Bitar avatar Joe Lauletta avatar  avatar Joel Dare avatar Isaac Nickolas avatar Devin Schumacher avatar Esther avatar Cédric Bahirwe avatar Timothy Chklovski avatar  avatar FURY 999 avatar Tommy Choy avatar Erik Oehm avatar Dudi Varaprasad avatar Hicham Abdelkaoui avatar AmirhosseinDotZip avatar Alex Canales avatar local avatar

Watchers

 avatar James Cloos avatar CP avatar Alexandros Kourtis avatar Md Najmul Hasan Khan avatar

markdown-live-preview's Issues

Groups of Lines Indentation

I was using Live Markdown Preview, and I realized you can't indent groups of lines together for code blocks. This would be a fantastic feature.

[Enhancement] Add copy button to preview

Currently a user must manually use their mouse to select all content and then use their keyboard to copy to their clipboard. Adding a single action to do this would streamline the UX.

Formatting out of date

There are format elements understood by Reddit at this time that are not being rendered correctly.

e.g.

block
of
text

That is:

three-back-ticks

block

of

text

three-back-ticks

Text wrapping

The markdown live preview site doesn't have text wrapping, so bloggers who use Markdown have to press enter on their keyboards when their paragraph goes past the screen. Maybe this should be fixed?

Breaks on Copy and Paste

When I pasted a prewritten markdown passage I was working on in my text editor, and tried to copy that passage again, the tab becomes unresponsive, and breaks. I lost all of the work because the page was unrecoverable. It happens when passing the readme attached below

README.md

Mathematical expressions in Markdown Live Preview

Mathematical expressions in Markdown Live Preview are not being rendered properly. For example, when using the syntax $O(n)$ --> $O(n)$ to display a mathematical expression, it is not detected or rendered.

Self-XSS

All js between script tags gets executed. I can't easily find a way to use this to attack other users, but it might be best to tame the beast while it is small.

image

Project up for design refresh?

Hi Guys @tanabe @jeffersonlam @mathisto
I am no code designer

I use this tool very frequently
Want to know if you guys are yup for design changes

I will make it more clean and beautiful + more powerful in terms of UX
I just want approval that yes there is some possibility that we can consider new design

and I will come back with new pull request

Thanks - Looking forward

Table styles are no longer copied when pasting into Outlook messages.

I liked to generate tables with that special format, copy and paste them into Outlook html messages.

I see that they made some changes, like the github logo no longer appears in the background, now on the upper right side.

But what does affect me is that the table styles are no longer copied.

Could you please return this functionality?

suggestion: Toggle Editor (and also horizontal resizer)

Sometimes I find the "editor" div a bit distracting after I paste in the MarkDown contents, so I wrote some CSS and JS to add a new "Toggle Editor" link to the top button bar, along with a green vertical bar in the middle of the 2 divs that you can drag-resize left or right.

I have only tried this in Chrome on desktop, not yet tested this in mobile etc. But for my needs it works well, I am quite happy with it.

Extra HTML: (added "toggleButton" next to "Copy" button, and added "resizer" div between "edit" and "preview")

  <div id="toggleButton"><a href="#">Toggle Editor</a></div>
...
  <div id="edit">...</div>
  <div id="resizer"></div>
  <div id="preview">...</div>

Extra CSS:

    body {
      margin: 0; /* Remove default margin */
      height: 100vh; /* Ensure full height usage */
      overflow: hidden; /* Prevent body scrollbars */
    }
    #container {
      display: flex;
      width: 100%;
      height: 100%; /* Full height of the parent */
      overflow: hidden;
    }
    #edit, #preview {
      flex-grow: 1;
      overflow: auto; /* Enable scrolling for content overflow */
      transition: flex 0.3s ease;
    }
    #resizer {
      width: 4px; /* Updated resizer width */
      background-color: green;
      cursor: col-resize;
      flex-shrink: 0; /* Prevent shrinking */
    }
    #toggleButton {
      margin-left: 16px; /* Ensure it doesn't overflow to hide */
    }
    .shrunk {
      flex: 0 0 0px !important;
    }

Extra JavaScript:

  const container = document.getElementById("container");
  const edit = document.getElementById("edit");
  const preview = document.getElementById("preview");
  const resizer = document.getElementById("resizer");
  const toggleButton = document.getElementById("toggleButton");
  const MIN_EDIT_WIDTH = 72; // Minimum width for the editor div

  let isMouseDown = false;

  resizer.addEventListener("mousedown", (e) => {
    isMouseDown = true;
    document.addEventListener("mousemove", resize);
    document.addEventListener("mouseup", stopResize);
  });

  function resize(e) {
    if (!isMouseDown) return;
    const containerRect = container.getBoundingClientRect();
    const newEditWidth = e.clientX - containerRect.left;

    if (newEditWidth >= MIN_EDIT_WIDTH) {
      edit.classList.remove("shrunk");
      edit.style.flex = `0 0 ${newEditWidth}px`;
      preview.style.flex = `1 1 auto`;
    }
  }

  function stopResize() {
    isMouseDown = false;
    document.removeEventListener("mousemove", resize);
    document.removeEventListener("mouseup", stopResize);
  }

  function toggleEditor() {
    edit.classList.toggle("shrunk");
  }

  toggleButton.addEventListener("click", toggleEditor);

NOTE: some of the CSS is the result of some back-and-forth tweaking via ChatGPT, so I'm not sure if they are the best way or might cause problems and/or the comments are even accurate, but again it seems to work #GoodEnough for my needs.

HTH!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.