-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
From this:
;;; -*- Mode: Lisp; Package: CCL; Coding: utf-8; -*-
(document "bug in code-block"
(code-block "#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <pwd.h>
int bufsize;
if ((bufsize = sysconf(_SC_GETPW_R_SIZE_MAX)) == -1)
abort();
char buffer[bufsize];
struct passwd pwd, *result = NULL;
if (getpwuid_r(getuid(), &pwd, buffer, bufsize, &result) != 0 || !result)
abort();
printf(\"%s\n\", pwd.pw_dir);"))
We get the output:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
bug in code-block</title>
</head>
<body>
<header><h1>bug in code-block</h1></header>
<div id="main-wrapper"> <div id="toc"><div class="sidebar">
<h2>Table of Contents</h2><nav><ul>
</ul>
</nav></div>
</div> <div id="contents-wrapper"> <div id="contents"><pre><code><p>#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <pwd.h></p>
<p>int bufsize;</p>
<p>if ((bufsize = sysconf(_SC_GETPW_R_SIZE_MAX)) == -1)
abort();</p>
<p>char buffer[bufsize];
struct passwd pwd, *result = NULL;
if (getpwuid_r(getuid(), &pwd, buffer, bufsize, &result) != 0 || !result)
abort();</p>
<p>printf("%sn", pwd.pw_dir);</p>
</code>
</pre>
</div> </div></div></body>
</html>
We need to respect whitespace and line breaks in the code-block. We don't want paragraphs in there.
Metadata
Metadata
Assignees
Labels
No labels