Skip to content

Modify the way in which one-file-mode metadata are stripped #973

Closed
Kwpolska opened this Issue Jan 4, 2014 · 0 comments

2 participants

@Kwpolska
Nikola, a static site generator member
Kwpolska commented Jan 4, 2014

Currently, Nikola has the following code for removing metadata comments from HTML output, copy-pasted in most compilers:

if not is_two_file:
    data = re.split('(\n\n|\r\n\r\n)', data, maxsplit=1)[-1]

This has one issue: this requires that:

  • the comment block is at the very top of the file
  • the comment block is separated by one empty line from the rest of the comment

Overall, this is kinda hacky. It’d be good if there was a better way, possibly one that isn’t littered all over our codebase.

Via: #957, @simonvanderveldt. CC @ralsina, @al3xandru.

@Kwpolska Kwpolska was assigned Jan 12, 2014
@ralsina ralsina modified the milestone: v6.5.0, v6.4.0 Feb 26, 2014
@ralsina ralsina modified the milestone: v7.0.0, v6.5.0 Mar 22, 2014
@Kwpolska Kwpolska modified the milestone: v7.1.0, v7.0.0 May 16, 2014
@Kwpolska Kwpolska modified the milestone: v7.2.0, v7.3.0 Nov 2, 2014
@ralsina ralsina modified the milestone: v8.0.0, v7.3.0 Jan 13, 2015
@ralsina ralsina modified the milestone: v8.0.0, 7.5.0 May 20, 2015
@ralsina ralsina modified the milestone: 7.5.0, 7.6.0 Jun 8, 2015
@ralsina ralsina added a commit that closed this issue Jun 9, 2015
@ralsina ralsina fix #973 8a522c8
@ralsina ralsina closed this in 8a522c8 Jun 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.