Giter VIP home page Giter VIP logo

markdowneditor's Introduction

Markdown Editor is using TextKit Framework and written in Swift language. It support following syntax highlight for now

  • Bold
  • Italic
  • Header
  • Link
  • Image Link
  • List
  • Inline Code
  • Code Block

I am using TextKit but I didn't use the edit self.editedRange because it will have a lot of problem for syntax highlighting. Example , I put the **bold** and then do the backspace. It will be like **bold. But text is still bold. editedRange change and didn't get that bold character text range.

Another problem is code block and header. After line breaking edit range has been changed and header color attribute didn't reset. So, if I want to use header color, I can't use code block. If I want to use code block , I can't use header color if I am using editRange. (may be I am wrong).

So, I use syntax highlighting for visual text range only. It's fast in iPhone because there is no so much text range on iphone screen. However, in iPad 2 , a bit slow becuase it's old devices. So, I put the timer in there.

Another reason for adding timer is , shouldn't do syntaxhihglighting again and agan when user doing non stop typing. Syntax highlight should do when user typing finish.

Screenshot

Image

Todo

  • Tested on iPad 2 and it's too slow for so many words and syntax color.
  • Should redo syntax highlighting after scrolling

markdowneditor's People

Contributors

saturngod avatar

Stargazers

 avatar

Watchers

 avatar

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.