ardumont / org2jekyll

Blogging with org-mode and jekyll without alien yaml headers.
GNU General Public License v2.0
71 stars 19 forks source link

Fix Option Messaged as Missing Edge Case #75

Closed LaurenceWarne closed 3 years ago

LaurenceWarne commented 3 years ago

Rapid summary

This PR fixes the edge case of some options being messaged as missing when they are specified.

What issue does this fix or improve?

With:

#+TITLE: title
#+STARTUP: showall
#+STARTUP: hidestars
#+OPTIONS: H:2 num:nil tags:t toc:nil timestamps:t
#+LAYOUT: post
#+AUTHOR: Laurence Warne
#+DATE: 2021-07-30 Fri 19:48
#+DESCRIPTION: 
#+CATEGORIES: my-category
#+TAGS: my-tag

M-x org2jekyll-publish messages:

org2jekyll - org2jekyll - This org-mode file is missing required header(s):
- The categories is required, please add ’#+CATEGORIES’ at the top of your org buffer.
- The description is required, please add ’#+DESCRIPTION’ at the top of your org buffer.

When only description is not specified. This PR hopes to solve this by tweaking the special line regex so it accepts options with empty values, but org2jekyll-get-options-from-buffer just doesn't add them the option plist, so that the option parsing is not ended prematurely.

Have you checked and/or added tests?

I've added a test for a watered down version of the above example.

Thanks!