GithubHelp home page GithubHelp logo

pagedown's Introduction

pagedown's People

Contributors

krtek4 avatar

Watchers

James Cloos avatar

pagedown's Issues

h4-h6 do not work

What steps will reproduce the problem?

Attempt to enter an h4, h5, or h6 like so:

#### Test
##### Test
###### Test

What is the expected output? What do you see instead?

Expect to convert to <h4>Test</h4> for example. Converts to unmarked-up text 
instead.


What version of the product are you using? On what operating system?

Using trunk code in Chrome 19, Mac OS X Snow Leopard


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 20 Feb 2012 at 8:37

Atx-style headers missing

What steps will reproduce the problem?
1. Enter three times the hash sign #
2. the output is no h3-tag


What is the expected output? What do you see instead?
Three # should generate a h3 heading (<h3> my headline </h3>
According to http://daringfireball.net/projects/markdown/syntax#header markdown 
should support html headers h1 down to h6 be entering n times the # sign.

What version of the product are you using? On what operating system?
The current version (july 2012).

Please provide any additional information below.
Take a look at the markdown page at daringfireball.net

Original issue reported on code.google.com by [email protected] on 22 Aug 2012 at 8:40

  • Merged into: #29

Support for Markdown Extra

PHP Markdown Extra (http://michelf.com/projects/php-markdown/extra/) is a great 
extension to markdown which supports table, definition list, header id and 
abbreviation, tables and definition lists are especially usefull when writing 
blogs and other types of documents, so it would be nice to support it.

Original issue reported on code.google.com by [email protected] on 22 Feb 2012 at 7:05

Prompt background does not disappear after 2nd try

When clicking the image button, the wmd-prompt-background appears. If the image 
insert is canceled using callback(null); in JavaScript, then the background 
disappears. However, if the user clicks the image button again, the 
wmd-prompt-background will appear again, but whether callback(null); or 
callback("http://someurlhere.com/photo.jpg"); is used, the background will not 
disappear.

The JavaScript Console shows at this time "Uncaught TypeError: Cannot call 
method 'removeChild' of null" in Markdown.Editor.js line 1684. 

I have attached the trace that the browser's console provides. The browser 
version is Google Chrome 20.0.1132.57 m on Windows XP.

Original issue reported on code.google.com by [email protected] on 25 Jul 2012 at 11:06

Attachments:

Localization of the editor

Hi,

I'm in the process of developing a website in french and I was wondering if you 
already thought of the Localization of the different parts of the editor ?

I'm willing to do the job if we can agree on the architecture behind the 
changes.

Thanks for the great work !

Original issue reported on code.google.com by [email protected] on 17 Sep 2011 at 10:42

npm module

How about publishing an npm module for nodejs usage? I could fork this project 
on github and publish an npm module myself, but it would be great if you 
consider adding one.

Thanks
Subbu

Original issue reported on code.google.com by [email protected] on 10 Aug 2011 at 4:13

Patch for /Markdown.Editor.js

Adds an optional second argument to linkEnteredCallback, allowing alt text to 
be specified instead of using the default.

The bracket-escaping is moved to the bottom of the function so it is applied to 
the alt text.

Original issue reported on code.google.com by jeremybanks.ca on 8 Feb 2012 at 6:11

Attachments:

IFrame support

Don't working from an IFrame.

Example usage - Facebook Canvas application.

Original issue reported on code.google.com by [email protected] on 26 Aug 2011 at 6:42

When referencing links with empty optional parameters, the converter fails

What steps will reproduce the problem?
1. write 
[14]:http://blog.thecanadaline.com/wp-content/uploads/2012/03/IMG_62441-225x300.
jpg ()\n\n
2. try to convert
3.

What is the expected output? What do you see instead?
we are expecting to have the link correctly coded inside the page, instead we 
have a broken link and the unconverted string appears at the end of the page as 
text: 
[14]:http://blog.thecanadaline.com/wp-content/uploads/2012/03/IMG_62441-225x300.
jpg ()\n\n

We should be able to furnish empty parameters in brackets without breaking the 
behaviour of the app...

What version of the product are you using? On what operating system?


Please provide any additional information below.
Removing the empty braces fixes the markdown.

Original issue reported on code.google.com by [email protected] on 13 Sep 2012 at 11:32

An url is not transformed to link if it's after a previous url separated only by a sole enter character

What steps will reproduce the problem?
1. Go to demo http://pagedown.googlecode.com/hg/demo/browser/demo.html
2. Add this text to any of the textboxes:
"http://google.com
http://google.com
text between links
http://google.com
"

What is the expected output? What do you see instead?
Expected:
"http://google.com http://google.com text between links http://google.com"
And all three links are clickable(so transformed to links)

Instead:
The second http://google.com is not transformed to a link.


What version of the product are you using? On what operating system?
Current live web demo.

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 23 Jan 2013 at 4:50

add footnote support

Footnotes are important!

When it comes to specs, I recommend conforming to what's becoming a sort of 
standard in markdown libraries:

http://freewisdom.org/projects/python-markdown/Footnotes
http://michelf.com/projects/php-markdown/extra/#footnotes

Original issue reported on code.google.com by [email protected] on 27 Sep 2011 at 7:37

Error in documentation, there is a bracket missing

Fairly simple.
Looking at the in-browser example for the Markdown.Sanitizer.js...

document.write(converter.makeHtml("<script>alert(42);</script><b>bold"); // 
creates "alert(42);bold"

you can find that there is only one closing bracket before the ;




Original issue reported on code.google.com by [email protected] on 25 Sep 2012 at 8:09

JavaScript files missing the MIT license header

I noticed that the four JavaScript files don't have a license header. This 
seems to be a common practice amongst JavaScript libraries out there. Would it 
be possible to add the information to the files, perhaps similar to jQuery's 
text?

( https://github.com/jquery/jquery/blob/master/src/intro.js )

Original issue reported on code.google.com by [email protected] on 18 Sep 2012 at 5:06

underscore (_) conversion not working if not preceeded by a space

What steps will reproduce the problem?
1. having a sting like August,29th_to:_ August,30th
2. there is no space before the leading "_"
3.

What is the expected output? What do you see instead?
We expect to see the bolded "to:", we have _to:_ instead

What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 13 Sep 2012 at 11:25

underscore (_) not recognized by the markdown converter

What steps will reproduce the problem?
1. Try to convert this a string like  _From: _July 30th, 2012 _to _August 5th, 
2012 

2. There are spaces after the string to be emphasized: _From: _
3.

What is the expected output? What do you see instead?
we would expect this:
<em>From: </em>July 30th, 2012 <em>to </em>August 5th, 2012
instead we have the input again:
_From: _July 30th, 2012 _to _August 5th, 2012 

What version of the product are you using? On what operating system?


Please provide any additional information below.

The space at the end seem to break the converter functionality

Original issue reported on code.google.com by [email protected] on 13 Sep 2012 at 11:22

Sanitizer needs a semicolon at the end

What steps will reproduce the problem?
1. use a tool like Chirpy to package all three Markdown.*.js files together: 
Converter, Sanitizer, and Editor.
2. include the javascript file in a page


What is the expected output? What do you see instead?

I'd expect the page to behave the same way as if I included the javascript 
files individually. Instead, it has a javascript error because Sanitizer ends 
with a function call that doesn't return anything, and Editor begins with a 
parenthesis, which makes the javascript think you're calling a function that 
got returned from the Sanitizer's initialization function.

You can fix this issue by adding a semicolon at the end of the Sanitizer.js 
file, as shown in the included Hg patch file.


Original issue reported on code.google.com by [email protected] on 1 Sep 2011 at 11:05

Attachments:

Fix the numbered list creation algorithm

This issue was already filed at the old 'wmd-new' repo.

The issue is still valid. I'm copypasting this as I just run into the very same 
problem.

What steps will reproduce the problem?
1. Type a list with each step on its own line

one
two
three

2. Highlight list and click the numbered list button
3. Rage at the resulting list

  1. one two three

What is the expected output? What do you see instead?

I want this:

one
two
three

to look like this:

 1. one
 2. two
 3. three


What version of the product are you using? On what operating system?

unknown version in chrome/ie

Please provide any additional information below.

The type-list/highlight/format-list pattern is common and any normal editor 
allows you to do this without deformatting your list and placing multiple lines 
on a single line.  Stop doing this, please.

Original issue reported on code.google.com by [email protected] on 10 Apr 2012 at 8:38

Sanitizer fails to find Markdown in certain requirejs environments

When building a bundle using some requireje-based tools each file is loaded in 
a separate closure, with the result that Markdown.Convertor creates a Markdown 
in a different scope than window and Markdown.Sanitizer then fails to find it. 
This can be fixed by modifying the converter to explicitly create 
window.Markdown as well:

diff --git a/src/3rdparty/pagedown/Markdown.Converter.js 
b/src/3rdparty/pagedown/Markdown.Converter.js
index 58fc54a..8c1a909 100755
--- a/src/3rdparty/pagedown/Markdown.Converter.js
+++ b/src/3rdparty/pagedown/Markdown.Converter.js
@@ -3,7 +3,7 @@ var Markdown;
 if (typeof exports === "object" && typeof require === "function") // we're in a CommonJS (e.g. Node.js) module
     Markdown = exports;
 else
-    Markdown = {};
+    Markdown = window.Markdown = {};

 // The following text is included for historical reasons, but should
 // be taken with a pinch of salt; it's not all true anymore.

Original issue reported on code.google.com by [email protected] on 4 Jan 2013 at 3:41

Markdown.Sanitizer.js should not use global window variable

We are trying to use Markdown.Sanitizer.js in Acre (a server-side javascript 
environement).

However, we find ourselves hacking a window object to use Markdown.Sanitizer.js.

But if Markdown.Sanitizer.js passes "this" as the "window" variable, we can use 
Markdown.Sanitizer.js on the server-side as is:

(function(window) {

...

})(this);


Original issue reported on code.google.com by [email protected] on 24 Sep 2012 at 2:59

'$' not defined after submitting hyperlink

What steps will reproduce the problem?
1. I start the Browser Demo.html 
2. I click the Hyperlink icon
3. I insert 'http://example.com/ "optional title"' as shown in example

What is the expected output? What do you see instead?

Foutdetails webpagina

Gebruikersagent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; 
Trident/4.0; .NET CLR 1.1.4322; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; 
.NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C)
Tijdstempel: Tue, 14 Aug 2012 21:41:20 UTC


Bericht: '$' is niet gedefinieerd
Regel: 1647
Teken: 17
Code: 0
URI: file:///C:/pl/pagedown/Markdown.Editor.js



What version of the product are you using? On what operating system?

IE8, pagedown Version 3151a581819f39123b0b5fd1ca9e26cebdcaa873

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 14 Aug 2012 at 9:53

Make #wmd-button-bar non-required

I use pagedown also in comment-form it has well keyboard shortcuts support, 
it's very useful to format small code snippets against typing 4 spaces every 
single line. But I have to put button bar on dom also. Of course I can hide it 
with css but that's not on true-way.

There are some other issues I want to post if you don't mind. Actually for now 
there is no any other editor to be used with markdown except markitup — which 
as to me very is very weird and do everything but nothing well.

Original issue reported on code.google.com by [email protected] on 11 Feb 2012 at 4:59

Need a prominent version number

In order to get this library updated on cdnjs, someone needs to submit a pull 
request which follows the rules at https://github.com/cdnjs/cdnjs  A very old 
version of this library is already on cdnjs as 1.0, but I can't find a proper 
version number for pagedown, so can't update that version number to the correct 
value when supplying the latest source.

Original issue reported on code.google.com by Forbes.Lindesay on 20 May 2012 at 10:23

Minor scoping issue in Markdown.Editor.js

The fakeButton variable used to handle the shift+enter indent is missing a var 
statement.

Patched at 
https://code.google.com/r/tmslft-pagedown/source/detail?r=785c6f8483248f084d0879
3da9e1cac5e2037ec8

Original issue reported on code.google.com by [email protected] on 8 Jan 2012 at 10:39

Can't make a relative link

The syntax [link](test.txt) does not work.  Instead, I see "link" (the word), 
but it is not made into a link for me.

Original issue reported on code.google.com by [email protected] on 16 May 2012 at 1:13

Links to open in new tab

Links could be improved to open in a new tab (it currently opens up in the same 
page).

Adding the target="_blank" attribute would fix it.

Original issue reported on code.google.com by [email protected] on 2 Feb 2012 at 3:48

An indented code block following a list, without an intervening paragraph, does not get formatted correctly

What steps will reproduce the problem?
1. Open /browser/demo.html
2. Input the following text into the editor:

This is a bug.

    here is a code block, properly monospaced

But if I start a list,

* even if it only has one item

    and then I try to make a code block, it doesn't work.

On the other hand, if I start another normal paragraph first,

    code blocks work again



What is the expected output? What do you see instead?

"    and then I try to make a code block, it doesn't work." should be displayed 
as a code block. Instead it is included as part of the list element.

What version of the product are you using? On what operating system?

changeset:   21:44a4db795617
tag:         tip
user:        balpha
date:        Fri Mar 02 14:55:03 2012 +0100

Original issue reported on code.google.com by [email protected] on 11 Apr 2012 at 3:22

Treat `&colon;` as `:` in URLs

Fixes an XSS vulnerability reported by Mario Heiderich 
(http://twitter.com/0x6d6172696f).

This change ensures that…

   new Markdown.Converter().makeHtml('**_[Free iPad Here!](javascript&colon;alert(1))_**')

…has the same result as…

   new Markdown.Converter().makeHtml('**_[Free iPad Here!](javascript:alert(1))_**')

Original issue reported on code.google.com by [email protected] on 9 Aug 2012 at 12:18

Attachments:

XSS: fails to escape link text in [<svg/onload=alert(1)//]() correctly

> new Markdown.Converter().makeHtml('[<svg/onload=alert(1)//]()')
→ '<p><a href=""><svg/onload=alert(1)//</a></p>'

This displays an alert in Firefox (XSS). Demo: 
data:text/html;charset=utf-8,<p><a href=""><svg/onload=alert('XSS')//</a></p>

Expected output is:

→ '<p><a href="">&lt;svg/onload=alert(1)//</a></p>'

I.e. the `<` should always be escaped.

Original issue reported on code.google.com by [email protected] on 9 Aug 2012 at 1:39

Support asynchronous module definition

Supporting asynchronous module definition [1] would allow to use 
CommonJS-compliant asynchronous javascript loaders like requirejs [2] on the 
client side.

This also allows to declare dependencies between modules, and to ensure that 
some module is loaded before an other.

This would look like this for Markdown.Converter:

``` Javascript
define(function() {
    // return Converter here
});

And for Markdown.Editor:

define(['Markdown.Converter'], function(Converter) {
    // return Editor here
});

And in the client code:

require(['Markdown.Converter', 'Markdown.Editor'], function(Converter, Editor) {
     // ...
});

With non-CommonJs compat:

var Markdown;

function doExport(factory) {
    if (typeof 'define' === 'function' && typeof 'require' === 'function') {
        define.call(this, factory);
    } else {
        Markdown.Converter = factory();
    }
}
doExport(function() {
     // ... return Converter
});

[1] http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition
[2] http://requirejs.org/


Original issue reported on code.google.com by `arnaud.lb` on 4 Aug 2011 at 5:09

Suggestion: live preview site, for bug reporting

If there was a live preview site for pagedown,
I could test out a bug on the current code.
Right now I can only report a bug against the current version in use somewhere, 
which might not be the current version.

Original issue reported on code.google.com by [email protected] on 27 Jan 2012 at 9:44

unbinding the editor

I use the editor within a 'modal' dialog within the page (using colorbox). When 
someone closes the dialog, I'd like to be able to cleanup after the editor has 
been shown so that if they re-open the dialog, everything is fresh again. 

This means unbinding any events and removing elements like the wmd-button-bar. 
Would it be possible to add a editor.close() function?

Original issue reported on code.google.com by [email protected] on 20 Dec 2011 at 12:33

Please pull handleUndo changes

Hi,

I implemented a shared settings object which allows you to tweak the editor at 
creation time without editing the code.

I also added a handleUndo switch which allows you to turn off the undo 
functionality which I needed for my project with shareJS.

The change is at 
http://code.google.com/r/woutmertens-noundo/source/detail?r=52c43623e71b1c912d68
4bd4b513c9fe1cc23c09

Original issue reported on code.google.com by [email protected] on 5 Jan 2012 at 3:56

Relative links don't work in the demo, parenthesis => %2a

What steps will reproduce the problem?
1. Go to demo http://pagedown.googlecode.com/hg/demo/browser/demo.html
2. Add this text to the unsanitized text box:
      "See my [About](about/) page for details."
    Example like: http://daringfireball.net/projects/markdown/syntax#link

What is the expected output? What do you see instead?
Expected the link to be to "about/", but it was to 
http://pagedown.googlecode.com/hg/demo/browser/%2aabout%2a/
Is my markdown syntax right? 

What version of the product are you using? On what operating system?

Current live web demo on current Chrome OSX.

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 22 Dec 2012 at 9:09

pull request for AutoNewLines port form MarkDownSharp

i cloned pagedown an ported the AutoNewLines option form MarkDownSharp to 
PageDown.

it could be usefull for other people as well, plz pull (and review) if you got 
the time.

http://code.google.com/r/marcdrexel-pagedown/

Original issue reported on code.google.com by [email protected] on 3 Aug 2012 at 11:38

UI buttons (bold, italic for example) use inaccessible code

Usage of WAI-ARIA and correct HTML would help ensure a slightly better 
experience.

For example using a <button> opposed to a <span> and using roles using as 
"application" and "menu" or "button" to the inserted mark-up shouldn't be that 
tricky to implement.

Am happy to hack around and provide more concrete examples if needed...


Original issue reported on code.google.com by [email protected] on 15 Nov 2011 at 9:42

Converter allows for headings up to h6, but sanitizer removes anything after h3.

What steps will reproduce the problem?
1. var converter = Markdown.getSanitizingConverter();
2. converter.makeHtml( '#h4-header')
3. the text 'h4-header' is returned.

What is the expected output? What do you see instead?
I expected '<h4>h4-header</h4>' to be returned

What version of the product are you using? On what operating system?
Latest version, OS X 10.7


Please provide any additional information below.

The issue is that on line 23 of Markdown-Sanitizer.js a whitelist is declared 
that only allows h tags up to h3.  However, line 747 of the 
Markdown-Converter.js allows h1-h6. Adding h4-h6 to the whitelist fixed the 
issues.

Original issue reported on code.google.com by [email protected] on 5 Jul 2012 at 4:52

  • Merged into: #29

mailto: no correctly rendered

What steps will reproduce the problem?
1. create some markdown with a link to send an email like 
[mail]([email protected])
2. call the converter on the string
string = '[mail](mailto:[email protected])'
converter.makeHtml(string);
3.

What is the expected output? What do you see instead?
The output should be 
<a href="mailto:[email protected]">mail</a>

instead we have
<a href="{absoluteURL}mailto%[email protected]">mail</a>

What version of the product are you using? On what operating system?


Please provide any additional information below.

This has been fixed by tweaking one of the attackLab functions (below), to 
avoid encoding the ":" when preceeded by "mailto".

function encodeProblemUrlChars(url) {
   if (!url)
     return "";
//if we have an "email:" type of link then do not encode the ":"
   else if (/mailto:/.test(url))
     return url;
   else {
     var len = url.length;
     return url.replace(_problemUrlChars, function (match, offset) {
    if (match == "~D") // escape for dollar
          return "%24";
    if (match == ":") { 
      if (offset == len - 1 || /[0-9\/]/.test(url.charAt(offset + 1)))
        return ":"
    } 
    return "%" + match.charCodeAt(0).toString(16);
     });
  }
}

Original issue reported on code.google.com by [email protected] on 17 Nov 2012 at 1:30

Attachments:

Add method to only make links

It would be great if the Markdown.Converter had a method which only created 
links. I'm dealing with feed posts and I don't want the user to be able to 
create headers and all that jazz.

Original issue reported on code.google.com by [email protected] on 2 Feb 2012 at 9:19

Creating bulleted list after numbered converts the first one to bulleted

Type this:
--------
Example:

 1. Number One
 2. Then Number Two


--------

on last second blank line press Ctr+U and you'll get this:
--------
Example:

 - Number One
 - Then Number Two
 - List item
--------

Chrome 17, Ubuntu
UPD: pressing Ctrl+U converts every list before to bulleted, and Ctrl+O 
converts them all to numbered

Original issue reported on code.google.com by [email protected] on 10 Feb 2012 at 6:39

Double postprocessing when using image dialog hook

I get:

![![enter image description here][5]][5]

What steps will reproduce the problem?

1. made a page much like the demopage
2. initialized it like the following

<script type="text/javascript">
    function my_dialog(callback){
        alert ("hello");
        var retval = callback("http://xyz.png/x.png");
        return true
    }
    var converter1 = Markdown.getSanitizingConverter();
    var editor1 = new Markdown.Editor(converter1);
    editor1.hooks.set("insertImageDialog",my_dialog)
    editor1.run();
</script> 

3. pressed the image link

What is the expected output? What do you see instead?
![enter image description here][5]

What version of the product are you using? On what operating system?
N/A

Please provide any additional information below.

I can make it work if commenting out the 
                postProcessing();


inside the linkEnteredCallback function


Original issue reported on code.google.com by [email protected] on 7 Oct 2011 at 2:47

Getting Uncaught SyntaxError on list creation

> Markdown.Editor.js:327
> Uncaught SyntaxError: Invalid flags supplied to RegExp constructor 'sfsdf 
sdfs dfsdf sdf sf'

How i got it: 
- type a list of words and create a new blank line at last
- select every line (except the blank one). The last non-blank one should be 
hilighted to the end of line — not end of last word in line.
- press Numbered or Bulleted list via shortcut or toolbar button

Since my English is not as well as I want so, attaching a screenshot :)

Original issue reported on code.google.com by [email protected] on 9 Feb 2012 at 7:56

Attachments:

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.