Skip to content

Commit 1eb4db8

Browse files
committed
Added exception for "Documentation" string.
1 parent 7b8fc1e commit 1eb4db8

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
META = {
2525
'name': 'ttws',
2626
'url': 'https://github.com/dietmarw/trimtrailingwhitespaces',
27-
'version': '0.8.1',
27+
'version': '0.8.2',
2828
'description': 'Script to remove trailing whitespaces from textfiles.',
2929
'classifiers': CLASSIFIERS,
3030
'license': 'UNLICENSE',

test/tests.mo

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ annotation (Diagram(coordinateSystem(extent={{-100,-100},{100,100}},
4444

4545
// Empty Documentation should be removed:
4646
annotation (Documentation);
47+
annotation( Documentation );
48+
annotation( Documentation, );
49+
annotation( Documentation , );
4750

4851
// Empty Documentation should be removed:
4952
annotation (Documentation(info="<html>
@@ -53,4 +56,11 @@ with model LossyGear and a proposed solution</a>&quot;
5356
</p>
5457
</html>"));
5558

59+
// Simple Documentation string should not be removed:
60+
annotation (Documentation(info="<html>
61+
<p>
62+
Some Documentation can be found here.
63+
Documentation at the start.</p>
64+
</html>"));
65+
5666
end LargeModel;

ttws/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def cleanAnnotation(filepath, eol):
177177
# special care of the last one again
178178
lastDocRef = (Optional(',') + ZeroOrMore(White(' \t'))
179179
+ (Keyword('Documentation')) + ~FollowedBy('/')
180-
+ ~nestedExpr() + ZeroOrMore(White(' \t')))
180+
+ ~nestedExpr() + FollowedBy(')'))
181181
out = Suppress(lastDocRef).transformString(out)
182182

183183

0 commit comments

Comments
 (0)