el2markdown icon indicating copy to clipboard operation
el2markdown copied to clipboard

Filter out -*- emacs magic comments in package description

Open jasonm23 opened this issue 9 years ago • 7 comments

jasonm23 avatar May 14 '15 23:05 jasonm23

proposed fix : https://github.com/Lindydancer/el2markdown/pull/4

jasonm23 avatar May 14 '15 23:05 jasonm23

I've had it on my TODO-list for a while, but haven't gotten around to fixing it. I will try to release a new version where this has been fixed as soon as possible.

Thanks for the feedback!

/ Anders

Lindydancer avatar May 16 '15 18:05 Lindydancer

OK, done. Please let me know if this works for you.

/ Anders

Lindydancer avatar May 16 '15 19:05 Lindydancer

This filtered out the header line altogether...

jasonm23 avatar May 19 '15 00:05 jasonm23

Seems to work with some packages, I'll look into this when I get a bit more time.

jasonm23 avatar May 19 '15 00:05 jasonm23

(note: I tested the failing package with my own patch, it also failed :( )

jasonm23 avatar May 19 '15 00:05 jasonm23

Hi!

This filtered out the header line altogether...

Seems to work with some packages, I'll look into this when I get a bit more time.

Could you provide an example of a package that failed.

I'm unclear why you chose to ignore the tested patch waiting for you in #4 https://github.com/Lindydancer/el2markdown/pull/4

One lesson I have learned over the 30+ years I've writing programs is that, if possible, it should be easy to read code and understand what it does. This is especially true if you have a large code base to maintain, like I do.

Your code used a very complex regexp which match lines both with and without a -- part. Unfortunately, this made the regexp so complex that I had to sit down and pick it apart to understand how it works. (It also uses the somewhat obscure regexp operator ".?".)

In contrast, even though it's a few lines longer, my code use two simple regexp:s, and the structure makes it easy to read. ("Match a header line." "Remove an unwanted part." "Print the result." "Done.")

/ Anders

On Tue, May 19, 2015 at 2:26 AM, JasonM23 [email protected] wrote:

(note: I tested the failing package with my own patch, it also failed :( )

— Reply to this email directly or view it on GitHub https://github.com/Lindydancer/el2markdown/issues/2#issuecomment-103281306 .

Lindydancer avatar May 19 '15 06:05 Lindydancer