Skip to content

Remove extra blank lines from page.njk output#1005

Merged
yamgent merged 1 commit into
MarkBind:masterfrom
ang-zeyu:page-njk-tests-fix
Feb 15, 2020
Merged

Remove extra blank lines from page.njk output#1005
yamgent merged 1 commit into
MarkBind:masterfrom
ang-zeyu:page-njk-tests-fix

Conversation

@ang-zeyu

@ang-zeyu ang-zeyu commented Jan 31, 2020

Copy link
Copy Markdown
Contributor

What is the purpose of this pull request? (put "X" next to an item, remove the rest)

• [x] Others

What is the rationale for this request?
Remove extra blank lines from page.njk output

What changes did you make? (Give an overview)
Removed blank lines from page.njk output using nunjucks's whitespace trimming {%-

Is there anything you'd like reviewers to focus on?
na

Testing instructions:
npm run test should pass

Proposed commit message: (wrap lines at 72 characters)
Remove extra blank lines from page.njk output

@yamgent

yamgent commented Feb 3, 2020

Copy link
Copy Markdown
Member

Thanks for this. Yes please update the expected files here, otherwise I will still have to do something like
2ad11f5 again anyway 😛.

@ang-zeyu

ang-zeyu commented Feb 3, 2020

Copy link
Copy Markdown
Contributor Author

Thanks for this. Yes please update the expected files here, otherwise I will still have to do something like
2ad11f5 again anyway 😛.

By updating tests I meant doing what 2ad11f5 does exactly actually 😅 ( made this pr before it )
Just to confirm, since its updated already, this pr wouldn't have any use right?

@yamgent

yamgent commented Feb 4, 2020

Copy link
Copy Markdown
Member

By updating tests I meant doing what 2ad11f5 does exactly actually 😅 ( made this pr before it )

I see, I mistakenly assumed that this PR was removing additional blank lines generated by the html output. If you are interested you can rework this PR to focus on that end goal instead.

So for example, given the following html output below, the blank lines at line 22 and 25 can actually be removed, if you replace {{ with {{- for the Nunjucks blocks in page.njk.

<link rel="stylesheet" href="markbind/css/markbind.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css">
<link rel="stylesheet" href="markbind/layouts/default/styles.css">
<link rel="stylesheet" href="markbind/css/site-nav.css">
</head>
<body>
<div id="app">
<div id="flex-body">
<nav id="site-nav" class="navbar navbar-light bg-transparent">
<div class="border-right-grey nav-inner position-sticky slim-scroll">
<ul class="px-0 site-nav-list">

The blank line at line 20 is also not supposed to be there, some html outputs do not have that blank line.

@ang-zeyu

ang-zeyu commented Feb 5, 2020

Copy link
Copy Markdown
Contributor Author

I see, I mistakenly assumed that this PR was removing additional blank lines generated by the html output. If you are interested you can rework this PR to focus on that end goal instead.

Misunderstood your intention as well. Thanks for the suggestion!

I've updated the test files and trimmed a few more blank lines.
The commit message is also changed to reflect the purpose better.

@ang-zeyu ang-zeyu changed the title Standardise page.ejs and page.njk whitespacing Remove extra blank lines from page.njk output Feb 5, 2020
@ang-zeyu

Copy link
Copy Markdown
Contributor Author

Rebased on latest, no changes

@yamgent yamgent added this to the v2.10.1 milestone Feb 15, 2020
@yamgent yamgent merged commit a1458b2 into MarkBind:master Feb 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants