Don't drop internal links #222

Merged
merged 4 commits into from Aug 26, 2016

Projects

None yet

2 participants

@sunu
Contributor
sunu commented Aug 25, 2016

I tried fixing #221 and this is the rough solution I have for now. If this looks ok, I can polish it up and add tests.

@winhamwr winhamwr commented on an outdated diff Aug 25, 2016
pydocx/export/html.py
@@ -270,6 +270,11 @@ def get_heading_tag(self, paragraph):
heading_style.name.lower(),
self.default_heading_level,
)
+ if paragraph.bookmark_name:
+ attrs = {
+ 'id': paragraph.bookmark_name
+ }
+ return HtmlTag(tag, **attrs)
@winhamwr
winhamwr Aug 25, 2016 Contributor

How about:
return HtmlTag(tag, id=paragraph.bookmark_name

@winhamwr
Contributor

Hello Tarashish,

This looks very reasonable to me. Add some tests and then I think this is ready for merging.

-Wes

@sunu
Contributor
sunu commented Aug 26, 2016

@winhamwr Hey! Thanks for the quick feedback. I have added tests now.

@winhamwr winhamwr merged commit 58d3b8e into CenterForOpenScience:master Aug 26, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@winhamwr winhamwr added a commit that referenced this pull request Aug 26, 2016
@winhamwr winhamwr Included #222 in the changelog fdac283
@winhamwr winhamwr added a commit that referenced this pull request Aug 26, 2016
@winhamwr winhamwr Added sunu to authors for #222 9cd76ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment