1. Oben Sonne
  2. poole
  3. Issues

Issues

Issue #9 resolved

when run with python2, markdown="1" does not work

Jonathan Zacsh
created an issue

Hey, I'm sorry if this is a lame bug report, I'll be happy to come back and give much more info later.

Basically, on a machine I use 1 that has python3 as the default interpreter, I always replace your shebang from saying "python" to "python2".

For some reason, on this particular computer, when I do a poole -b on the same code base, anything within an <element markdown="1"> doesn't get interpreted. As a work around I've been running poole -b on another machine [2] and scp'ing the output directory over :)

Any thoughts on why this is happening?

[2]: Ubuntu 11.10

Comments (8)

  1. Anonymous

    Any raw html markup in the file that you would like to still be markdown-interpreted. eg: <p id="stuff" markdown="1"> A sentence with a link, [mylink][] to be interpolated by python-markdown. </p>

  2. Oben Sonne repo owner
    • changed status to open

    This reason probably is that your systems use different versions of Python markdown (PyMD). Up until PyMD 2.0.3 any markdown content inside HTML block elements have been converted automatically, independent of the markdown="1" attribute. Since PyMD 2.1 this behavior has been disabled. Now, the attribute markdown="1" is required and the markdown extra extension has to be enabled, i.e. you have to run poole with the --md-ext options, for instance like this:

    $ poole.py --md-ext extra --build
    

    Does this solve your issue?

  3. Jonathan Zacsh reporter

    Ah, thank you so much for looking into this! Sounds right, as I have python-markdown 2.1.1-4

    Unfortunately I get the following output on running the above command:

    info   : convert ./input/code.md
    Traceback (most recent call last):
      File "/home/me/bin/local/poole", line 660, in <module>
        main()
      File "/home/me/bin/local/poole", line 654, in main
        build(opts.project, opts)
      File "/home/me/bin/local/poole", line 507, in build
        page.html = markdown.Markdown(extensions=opts.md_ext).convert(out)
      File "/usr/lib/python2.7/site-packages/markdown/__init__.py", line 280, in convert
        self.lines = prep.run(self.lines)
      File "/usr/lib/python2.7/site-packages/markdown/preprocessors.py", line 175, in run
        if self.markdown_in_raw and 'markdown' in attrs.keys():
    AttributeError: 'tuple' object has no attribute 'keys'
    
  4. Oben Sonne repo owner

    Sorry, I cannot reproduce this in my setup (Python 2.6, python-markdown 2.1.1). Could you specify the version you are using, as well as provide an example markdown file in the input folder which causes this error (e.g. your code.md file)?

  5. Jonathan Zacsh reporter

    Sorry for the delay responding. Versions:

    • python: 2.7.3
    • python-markdown: 2.1.1-4

    The top of my code.md file:

    title: code
    menu-position: 3
    ---
    
    #Code
    
    <section class="code-tldr" markdown="1">
    
    **tldr;** I'm a happy [github user][github].<br />
    If you find nothing fun on my github page, feel free to keep reading. Below are
    utilities I wrote because I needed the tool myself or I wanted to play with the
    technology. Bottom line, these are the ones I tried to write with _some_ sort
    of re–usability in mind, so others can enjoy. If anything comes in handy (_or
    breaks_) let me know.
    
    </section><!--//.code-tldr-->
    
    

    Attached is an example screenshot of just this code both working and not working.

  6. Log in to comment