Code Monkey home page Code Monkey logo

markdown.tmbundle's Introduction

Installation

You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you.

General

License

If not otherwise specified (see below), files in this repository fall under the following license:

Permission to copy, use, modify, sell and distribute this
software is granted. This software is provided "as is" without
express or implied warranty, and with no claim as to its
suitability for any purpose.

An exception is made for files in readable text which contain their own license information, or files where an accompanying file exists (in the same directory) with a “-license” suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example “tidy” is accompanied by “tidy-license.txt”.

markdown.tmbundle's People

Contributors

bnmnetp avatar dipnlik avatar doekman avatar fredb avatar giucal avatar hadley avatar infininight avatar jrus avatar lilyball avatar mkhl avatar noniq avatar sanssecours avatar simongregory avatar skurfer avatar sorbits avatar soryu avatar windwiny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

markdown.tmbundle's Issues

Markdown: Shell fenced code block have incorrect syntax highlighting after indent

I created a sh sample code with some comments inside a fenced code block, place it after an list item and then indent it.
If I indent the code block, the syntax highlighting loses its color.
The bug is in the markdown editor and preview.

Does this issue occur when all extensions are disabled?: YES

Basic Information

  • VS Code Version: 1.77.3 (user setup)
  • OS Version: Windows_NT x64 10.0.19045
  • Color Theme: Dark+ (default dark)

Steps to Reproduce:

  1. Open markdown file
  2. Create list
  3. Add a code block (see sample code below)
  4. See the result (see screenshots below)

Sample Code

1. List One

```sh
sudo apt-get purge --autoremove -y google-chrome-stable

# with alias
remove -y google-chrome-stable
```

1. List Two

    ```sh
    sudo apt-get purge --autoremove -y google-chrome-stable

    # with alias
    remove -y google-chrome-stable
    ```

1. List Three

    ```sh
        sudo apt-get purge --autoremove -y google-chrome-stable

        # with alias
        remove -y google-chrome-stable
    ```

Screenshots

Actual behavior

md-with-error

Expected behavior

md-with-good

Originally from @adorade in microsoft/vscode#180246

Header with only CJK characters break html

runing 2.0-beta.12.26

Header item will convert to H1-6 with id.
If the contents is only CJK chars, last quotation mark for id is short.

here is a sample.

# 第一階層

top level

## 第二階層

second level

## 第三階層

third level

Show Preview shots

screen shot 2016-10-26 10 19 05

output from Convert Document to HTML

<h1 id=">第一階層</h1>

<p>top level</p>

<h2 id=">第二階層</h2>

<p>second level</p>

<h2 id=">第三階層</h2>

<p>third level</p>

I expect this output.

<h1 id="">第一階層</h1>

<p>top level</p>

<h2 id="">第二階層</h2>

<p>second level</p>

<h2 id="">第三階層</h2>

<p>third level</p>

Lists Are Only Found If After A Newline

The Markdown grammar has this for lists:

lists = {
    patterns = (
        {   name = 'markup.list.unnumbered.markdown';
            comment = 'Currently does not support un-indented second lines.';
            begin = '(^|\G)([ ]{0,3})([*+-])([ ]{1,3}|\t)';
            while = '\G([ ]{4}|\t|$)';
            beginCaptures = { 3 = { name = 'punctuation.definition.list.markdown'; }; };
            patterns = (
                {   include = '#list_paragraph'; },
                {   include = '#block'; },
            );
        },
        {   name = 'markup.list.numbered.markdown';
            begin = '(^|\G)([ ]{0,3})([0-9]+\.)([ ]{1,3}|\t)';
            while = '\G([ ]{4}|\t|$)';
            beginCaptures = { 3 = { name = 'punctuation.definition.list.markdown'; }; };
            patterns = (
                {   include = '#list_paragraph'; },
                {   include = '#block'; },
            );
        },
    );
};

For some reason it hits for lists starting after a newline:

hit

But not right after a paragraph:

miss

And I can't imaging why. The (^|\G) capture group should hit looking only at the start of a line, not what precedes it.

Why does it behave wrongly (IMHO)?

Traceback when increasing heading level

To reproduce:

  • Open a blank document.
  • Set document type to Markdown.
  • Type #hi.
  • Type command-] or mouse to Bundles > Markdown > Headings > Increase Heading Level.

Result:

Failure running “Increase Heading Level”.
Traceback (most recent call last):
  File "Increase Heading Level", line 16, in <module>
    heading = m.group(2).strip()
AttributeError: 'NoneType' object has no attribute 'group'

TextMate version 2.0.0-alpha.9346.

Header style does not honor soft wrap

Steps to reproduce:

  • create a markdown document

  • turn on soft wrapping

  • create a long header name using hashes, for example:

    ## This is my really long chapter title: don't you wish it were shorter?
    

Expected result:

  • I would have expected the enlarged typeface for the header to be soft wrapped as the regular text is.

Actual result:

  • header runs off the right hand side of the page, hiding the text instead of wrapping it. Here is an example.

Environment:

  • OS X 10.8.3, TextMate version 2.0-alpha.9413

Printing Markdown preview crashes TM

Hi,

When printing the Markdown preview (⌃⌥⌘P) via ⌘P to a PDF-file or to Preview.app, crashes TM completely.

fyi, printing via the Multi Markdown bundle goes OK.

--feek

How do I get Syntax Highlighting?

I can see that the bundle is installed, but I don't have any highlighting. This is what I did:

    mkdir -p ~/Library/Application\ Support/TextMate/Bundles
    cd ~/Library/Application\ Support/TextMate/Bundles
    git clone https://github.com/textmate/markdown.tmbundle.git markdown.tmbundle

    touch /tmp/test.md
    open /tmp/test.md

I also tried .markdown as an extension.

Refresh markdown preview window

It would be awesome if you were able to refresh the Markdown preview window without having to close and reopen the preview.

One option could be a key command.
A better alternative would be to have the Preview window live update like the Mou app does.

Auto Expand Headings adds “#"

I am unable to find where this happens (in the bundle), but would like to disable it. Marked thinks the “#” is a character to be displayed, and not a delimiter.

e.g.

Lorem or

and you get this:

Lorem

Marked thinks it’s supposed to display like this:

Lorem #

that is NOT what I want.

Any way to disable this? Or is this a standard?

Thanks
Mark

ADDENDUM

  • I just turned off using “discount” (aka GFM) in Marked, and now headers format correctly.
  • I also noticed that COMMAND+ does not do add the trailing “#"

Hash comments in code blocks

If I make a markdown file containing something like this:

# does something
print("Hello, world")

The comment # does something is a really big font, since it's displaying as if it were a <h1>. If nobody else wants to, I might have a go at fixing this.

List auto complete + tab separate font

TM2 always autocompleted markdown lists. E.g., after typing "- list item one" and hitting return, the next line would display "- ", the hyphen and space there waiting for me with the cursor placed after the space to start writing the next bullet point.

This no longer happens and I'm wondering why. Is it just my version or do others have this problem?

Also, when I tab in the text appears in a different font and breaks the page wrap. Screenshot: http://cl.ly/ZrX5

Am I setup wrong on this or is this something in the bundle itself?

Thanks, all.

New Item/Subitem broken

Hi,

When I run the new item or new subitem commands I get a ruby error. The parse function that the new item/subitem calls from the markdown.rb file uses a method str.to_a() which doesn't seem to work. This is on OS X Mavericks, which may be using a new version of ruby than this script was expecting?

Override Auto-Formatting (Font sizing)

Hello!

This could be my theme doing this, but I got consistent sizing issues with several different themes, so I just wanted to check in.

I'd like my font sizes to be consistent here. How can I go about doing that?

screen shot 2013-05-22 at 11 31 36 pm

Dragging files with spaces in filename produces broken link in preview

Textmate markdown bundle: Insert Image tag Dragaction Command

Dragging a file, that has spaces in the filename will break the inserted link.
The additional line in the command converts spaces to %20.
While Firefox and other browser don't mind mucht for spaces, the mardown preview won't show images.

change

base=${TM_DROPPED_FILE##*/}
alt=$(tr <<<${base%.*} '[_-]' ' '|perl -pe 's/(\w+)/\u$1/g')
if [ -n "$TM_DROPPED_FILE_STRIP_ROOT" ]
then
    file=$(sed -e "s|^$TM_DROPPED_FILE_STRIP_ROOT||" <<< $TM_DROPPED_FILE);
else
    file=${TM_DROPPED_FILE};
fi
echo -n "![\${1:$alt}]($file)"

to

base=${TM_DROPPED_FILE##*/}
alt=$(tr <<<${base%.*} '[_-]' ' '|perl -pe 's/(\w+)/\u$1/g')
if [ -n "$TM_DROPPED_FILE_STRIP_ROOT" ]
then
    file=$(sed -e "s|^$TM_DROPPED_FILE_STRIP_ROOT||" <<< $TM_DROPPED_FILE);
else
    file=${TM_DROPPED_FILE};
fi
file=`echo $file | sed -e 's/ /%20/g'`
echo -n "![\${1:$alt}]($file)"

Extended Markdown Bundle

Would it be possible add support for a few extended markdown features? I'm mainly thinking of support for the commonly used fenced code blocks. If you're concerned about automatically formatting non-standard markdown, then perhaps this could be something that's turned off by default, which can be enabled within the bundle settings.

I understand someone made a request for full github flavoured markdown support #9. If indeed you'd prefer to split this out into a new bundle using markdown as it's base, can I make a vote for that? I think many of these extensions, at least fenced code blocks, are common enough to warrant making it an official bundle.

Perhaps there's an opportunity here to even support the class hinting that fenced code blocks allow, and which is commonly used for code highlighting. So if someone marks a fenced code block with the ruby class hint, then Markdown can render the content of that code block using the grammer from the ruby bundle. That'd be pretty awesome.

Thoughts?

No hyphen list support. Need to advance on "Return" instead of "Enter"

I expected the markdown bundle to work the same as previous MD bundle in TM1.

  1. Type a hyphen and space to start a list: "- "
  2. type some shit.
  3. hit Return... expected behavior is another "- " being added to the beginning of the next line. This does not happen.
  4. another shot of tequila.... try again. no dice. get terrified/angry.

I've discovered that this MD bundle expects lists to use asterisks ( * ) instead of hyphens and "Enter" instead of "Return" (fn+return on laptop). Both of these require extra keystrokes (sub-optimal) and it seems unnecessary to change the behavior from TM1.

This is my humble request for an update to this behavior.

Big fan. Thanks.

Formatting with multiple fonts and sizes is distracting

Have been using this bundle with the latest Textmate 2.0 alpha, and find the use of different (variable width) fonts, and at different sizes, distracting.

It ruins the whole typewriter vibe that you get from writing in a text editor--not to mention that there's just something really uncomfortable about combining fixed-width and variable fonts in the same view. It's exposure to this kind of overdesign that writers move to Markdown to escape...

Is it possible to have an option, or a separate bundle in the repository, that sticks to one font and size throughout, like the old bundle that came with Textmate 1.x?

Error using lists in Markdown

I can create one new subitem in a list but when I try to create another list item I get this error message:

Failure running “New Item”.

/Users/geoffreysnyder/Library/Application Support/TextMate/Managed/Bundles/Markdown.tmbundle/Support/lib/markdown.rb:320:in parse': undefined methodlines' for nil:NilClass (NoMethodError)
from New Item:11

As long as I only create lists without subitems the create new item works as expected.

YAML Front Matter Formatting?

Are there plans to add formatting for YAML front matter in a Markdown document? This is getting to be a pretty standard thing in many flat-file CMSs.

If there are no plans, how would I go about adding such a thing?

github triple backtick code support

Github Markdown can use triple backticks to start and end a code section, this is useful because it's the only way to specify a language for syntax highlighting.

Would it be appropriate to include this in the markdown bundle (given it's github flavored markdown)?

As of now README files look a a little sad if you're using the triple backtick syntax.

Bundle stopped working with the update of TextMate

I get the following error message:

Failure running “Syntax Cheat Sheet”.
Syntax Cheat Sheet: line 4: /lib/webpreview.sh: No such file or directory
Syntax Cheat Sheet: line 5: html_header: command not found
Syntax Cheat Sheet: line 6: Markdown.pl: command not found
Syntax Cheat Sheet: line 7: html_footer: command not found

Just after updating to TextMate version 2.0-alpha.9495 it stopped working properly.

Failure running “Level 2 [setext]”.

I just noticed this happening. I rarely use the SETEXT. Any help as to why I am getting this. I’m not sure where to start.

Yosemite 10.10.1
TextMate version 2.0-beta.6.5
ruby 2.0.0p481
latest version of markdown bundle

markdownbundleissue

update

it appears that “/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby” does not exist. “/System/Library/Frameworks/“ is as far as it goes.

Math blocks can break syntax highlighting

When specifying Markdown (MathJax) math blocks for writing equations, some equation characters will break the syntax highlighting for the file, making all of the text below the equation unhighlighted. This happens most frequently with equations that have underscores in them. Here is an example:

If the offending equation is removed, the highlighting is restored:

Everything inside of double-dollar signs ($$) should be considered part of the equation.

Code not formatted properly

Snapshot is self explanatory:
screenshot 2015-09-05 00 53 33

Compare it with how this code looks:

///========================== main.cpp ==========================
/// iostream provides basic input/output functionalities (cout)
#include <iostream>
/// iostream is part of the "std" namespace. The keyword "using" can 
/// be employed to avoid typing std::cout throughout the code
using namespace std;

/// main is the entry point of your program. It needs to be 
/// defined and always have this signature. The argc and argv 
/// are used to pass parameters from command line.
int main(int /*argc*/, char** /*argv*/){
    /// @todo find out how to print "helloworld" to terminal
    /// @solution  
    cout << "helloworld" << endl;

    /// The main function should always return a value.
    /// This tells the application whether it exited 
    /// correctly or not (legacy error management)
    return EXIT_SUCCESS;
}

Also, disabling soft-text wrap in textmate whenever you are in a code block would be a good idea!

Automatic numbering in the Markdown in TextMate 2

In the TextMate 2 markdown bundle, why do I have to manually type the numbers in my numbered lists?

After doing:

  1. asdf

and pressing Enter, why do I manually have to type

  1. foo
  2. bar

and if I insert an element in between, why do I have to manually change the other numbers? Shouldn't it be more intelligent than this?

Just wondering.

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.