pawamoy / pawamoy/markdown-exec

No output without print and no line breaks

Open
#25 4 comments 2 reactions 1 assignee View on GitHub

@pawamoy is already working on this.

Since Jun 13, 2024.

feature
Dominant language
Python
Stars
174
Forks
21
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
First of all, thanks for this very nice plugin. There are two issues, probably related:

  1. Output is only generated with print, not by calling the variable/object.

    This will produce nothing:
    '''python exec="on" source="material-block"
    x=1
    x
    '''

    This will work:
    '''python exec="on" source="material-block"
    x=1
    print(x)
    '''
    1

  2. Line breaks are not respected.

    This will print the two numbers next to each other, rather than below each other.
    '''python exec="on" source="material-block"
    x=1
    y=1
    print(x)
    print(y)
    '''
    1 2

Expected behavior
I would expect the output to be as in the console, so that the code examples are representative of real use.

System (please complete the following information):

  • Markdown Exec version: 1.6.0
  • Python version: e.g. 3.10
  • OS: Windows

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.