10
votes
Accepted
9
votes
Print code-fenced sections of a Markdown document
While your code looks ok, it could be improved greatly by making use of RS (record separator) and NR number of record, provided ...
7
votes
Print code-fenced sections of a Markdown document
The Code looks perfect to me.
I thought about using the flip-flop operator, but since you take additional action at the beginning and the end of the code block, this may be difficult in this case.
<...
6
votes
Accepted
Parsing Markdown with bare hyperlinks: Hoping to find a way to workaround the "noscript" workaround
Fundamentally, I see two other options:
<textarea>
<textarea>'s seem to be an option, in that they share the ...
5
votes
Accepted
Command line todo list manager
Your program expects the user to refer to completed or incomplete tasks by a numeric index. However, the Markdown file contains an unnumbered bulleted list, which forces the user to count the items ...
4
votes
Accepted
Print code-fenced sections of a Markdown document
You could shorten the code with the next statement, which skips the current rule as well as all following it and starts a next iteration on the next input record.
...
3
votes
Accepted
Adding prefixes to headers in markdown
I may not be considering all fringe cases (please enlighten me if this breaks with any realistic input), but all of the logic can be packed into a single ...
3
votes
Accepted
Fetch StackOverflow questions and save them to a markdown table
Things look good and well organised at first glance. However, there are a few things you can make use of.
Use f-string over using str.format. The former is more performant.
You can group the columns ...
3
votes
Accepted
Formatter for converting links in a legacy markup to markdown
The magic numbers used to check the diff, e.g., diff[0][0] == 1 && diff[1][0] == 0
One small improvement is that ...
3
votes
Accepted
Converting Markdown to HTML using Go
Performance
Regex
regex.MustCompile() is very expensive! Do not use this method inside a loop !
instead, define your regex as global variables only once:
<...
2
votes
Monthly attendance report for some company employees
I think you can simplify your code quite a bit if you compute all the summary metrics once for all in a single function. This way, you also avoid repetitive calls to read_excel:
...
2
votes
Accepted
Script to loop through a list of YouTube channels, and output metadata to a Markdown file
Nice script!
Read multiple values by name rather than into an array
Instead of:
...
2
votes
Accepted
Markdown code formatter
Bug
Take a look at what happens if I combine block doc comments and doc test. This perfectly reasonable code:
...
2
votes
Fetch StackOverflow questions and save them to a markdown table
The code looks really good, so I'll ask some questions on the design decisions that have been made.
Path(__file__).parent.resolve()
I haven't used this before, so ...
2
votes
Accepted
Tab 2 spaces convertor (for markdown)
A lot of the code in your while loop can be replaced with a for loop using enumerate() and a toggled boolean.
You should be able to replace your code from ...
1
vote
Accepted
Easy to use code preparation script for CodeReview questions
An alternative to defaulting variables by self-assigning with fallback is to use ${parameter:=word} at the point of first use:
...
1
vote
Regex to parse horizontal rules in Markdown
The following is closer to the CommonMark Spec as "it is required that all of the characters other than spaces or tabs be the same" and only up to 3 spaces are permitted in front of the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
markdown × 51python × 11
javascript × 11
html × 10
regex × 7
parsing × 6
c# × 5
python-3.x × 5
ruby × 5
c × 3
ruby-on-rails × 3
wpf × 3
pdf × 3
performance × 2
beginner × 2
strings × 2
.net × 2
reinventing-the-wheel × 2
node.js × 2
json × 2
console × 2
bash × 2
formatting × 2
react.js × 2
converting × 2