Skip to content

Commit f3174eb

Browse files
committed
Use the paragraph's text directly
Fixes the rendering of bulleted lists in structures.
1 parent 8ec5a2a commit f3174eb

File tree

3 files changed

+49
-5
lines changed

3 files changed

+49
-5
lines changed

lib/docurium/docparser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def extract_function_args(cursor, cmt)
149149

150150
def extract_subject_desc(comment)
151151
subject = comment.child.text
152-
paras = comment.find_all { |cmt| cmt.kind == :comment_paragraph }.drop(1).map { |p| p.map(&:text).join() }
152+
paras = comment.find_all { |cmt| cmt.kind == :comment_paragraph }.drop(1).map { |p| p.text }
153153
desc = paras.join("\n\n")
154154
return subject, desc
155155
end

test/docurium_test.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,16 @@ def test_can_parse_function_cast_args
161161
assert_equal 'int (*)(const char *, void *)', func[:args][2][:type]
162162
assert_equal 'Function which will be called for every listed ref', func[:args][2][:comment]
163163
expect_comment =<<-EOF
164-
<p>The listed references may be filtered by type, or using a bitwise OR of several types. Use the magic value <code>GIT_REF_LISTALL</code> to obtain all references, including packed ones.</p>
165-
166-
<p>The <code>callback</code> function will be called for each of the references in the repository, and will receive the name of the reference and the <code>payload</code> value passed to this method.</p>
164+
<p>The listed references may be filtered by type, or using
165+
a bitwise OR of several types. Use the magic value
166+
<code>GIT_REF_LISTALL</code> to obtain all references, including
167+
packed ones.</p>
168+
169+
<p>The <code>callback</code> function will be called for each of the references
170+
in the repository, and will receive the name of the reference and
171+
the <code>payload</code> value passed to this method.</p>
167172
EOF
168-
assert_equal expect_comment.split("\n").map(&:strip), func[:comments].split("\n")
173+
assert_equal expect_comment.split("\n"), func[:comments].split("\n")
169174
end
170175

171176
def test_can_get_the_full_description_from_multi_liners

test/fixtures/git2/repository.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,45 @@ GIT_EXTERN(const char *) git_repository_path(git_repository *repo);
212212
*/
213213
GIT_EXTERN(const char *) git_repository_workdir(git_repository *repo);
214214

215+
/**
216+
* Extended options structure for `git_repository_init_ext`.
217+
*
218+
* This contains extra options for `git_repository_init_ext` that enable
219+
* additional initialization features. The fields are:
220+
*
221+
* * flags - Combination of GIT_REPOSITORY_INIT flags above.
222+
* * mode - Set to one of the standard GIT_REPOSITORY_INIT_SHARED_...
223+
* constants above, or to a custom value that you would like.
224+
* * workdir_path - The path to the working dir or NULL for default (i.e.
225+
* repo_path parent on non-bare repos). IF THIS IS RELATIVE PATH,
226+
* IT WILL BE EVALUATED RELATIVE TO THE REPO_PATH. If this is not
227+
* the "natural" working directory, a .git gitlink file will be
228+
* created here linking to the repo_path.
229+
* * description - If set, this will be used to initialize the "description"
230+
* file in the repository, instead of using the template content.
231+
* * template_path - When GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE is set,
232+
* this contains the path to use for the template directory. If
233+
* this is NULL, the config or default directory options will be
234+
* used instead.
235+
* * initial_head - The name of the head to point HEAD at. If NULL, then
236+
* this will be treated as "master" and the HEAD ref will be set
237+
* to "refs/heads/master". If this begins with "refs/" it will be
238+
* used verbatim; otherwise "refs/heads/" will be prefixed.
239+
* * origin_url - If this is non-NULL, then after the rest of the
240+
* repository initialization is completed, an "origin" remote
241+
* will be added pointing to this URL.
242+
*/
243+
typedef struct {
244+
unsigned int version;
245+
uint32_t flags;
246+
uint32_t mode;
247+
const char *workdir_path;
248+
const char *description;
249+
const char *template_path;
250+
const char *initial_head;
251+
const char *origin_url;
252+
} git_repository_init_options;
253+
215254
/** @} */
216255
GIT_END_DECL
217256
#endif

0 commit comments

Comments
 (0)