Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I think the sed expression is having difficulty with a tag #1

Open
ecasilla opened this issue Oct 14, 2015 · 1 comment
Open

I think the sed expression is having difficulty with a tag #1

ecasilla opened this issue Oct 14, 2015 · 1 comment

Comments

@ecasilla
Copy link

$ ./node_modules/.bin/sweeten-docco Sweetening docco... sed: 3: "/<p>/,/<\/p>/ { /<d ...": bad flag in substitute command: '#' Done.

@ecasilla
Copy link
Author

$ bash -x ./node_modules/.bin/sweeten-docco
++ sed_cmd
++ local cmd=
+++ uname
++ local os=Darwin
++ case $os in
++ cmd='sed -E -i .orig'
++ printf 'sed -E -i .orig'
+ SED='sed -E -i .orig'
+ [[ -e docs ]]
+ cd docs
+ echo -n 'Sweetening docco... '
Sweetening docco... + jsdocTags='author constructor deprecated exception param private property return see this throws version'
+ codoTags='abstract author concern copyright deprecated example extend include note method mixin option overload param private return see since todo version'
+ extendedTags=api
++ echo api abstract author concern copyright deprecated example extend include note method mixin option overload param private return see since todo version author constructor deprecated exception param private property return see this throws version
++ uniq
+ allTags='api abstract author concern copyright deprecated example extend include note method mixin option overload param private return see since todo version author constructor deprecated exception param private property return see this throws version'
++ echo api abstract author concern copyright deprecated example extend include note method mixin option overload param private return see since todo version author constructor deprecated exception param private property return see this throws version
++ sed 's/ /|/g'
+ anyTag='api|abstract|author|concern|copyright|deprecated|example|extend|include|note|method|mixin|option|overload|param|private|return|see|since|todo|version|author|constructor|deprecated|exception|param|private|property|return|see|this|throws|version'
+ newLine='
'
+ sed -E -i .orig 's/(.)(<p>|<\/p>)/\1\
\2/g' async.html test.html
+ sed -E -i .orig 's/(<p>|<\/p>)(.)/\1\
\2/g' async.html test.html
+ inParagraph='/<p>/,/<\/p>/'
+ sed -E -i .orig '/<p>/,/<\/p>/ {
    /<div class="doc-tag">/ b     # Skip if processed already
    /@(api|abstract|author|concern|copyright|deprecated|example|extend|include|note|method|mixin|option|overload|param|private|return|see|since|todo|version|author|constructor|deprecated|exception|param|private|property|return|see|this|throws|version)/ s/</\&lt;/g    # These document typed arrays
    /@(api|abstract|author|concern|copyright|deprecated|example|extend|include|note|method|mixin|option|overload|param|private|return|see|since|todo|version|author|constructor|deprecated|exception|param|private|property|return|see|this|throws|version)/ s/>/\&gt;/g
  }' async.html test.html
sed: 3: "/<p>/,/<\/p>/ {
    /<d ...": bad flag in substitute command: '#'
+ sed -E -i .orig '/<p>/,/<\/p>/ s/(@(api|abstract|author|concern|copyright|deprecated|example|extend|include|note|method|mixin|option|overload|param|private|return|see|since|todo|version|author|constructor|deprecated|exception|param|private|property|return|see|this|throws|version).*)/<div class="doc-tag">\1<\/div>/' async.html test.html
+ paramTypeBegin='[[{]'
+ paramTypeEnd='[]}]'
+ paramTypeTokens='[^[:space:]]+'
+ paramType='[[{][^[:space:]]+[]}]'
+ paramNameTokens='(,[[:space:]]+|[^[:space:]<])+'
+ sed -E -i .orig '/<p>/,/<\/p>/ s/(@param|@property) +([[{][^[:space:]]+[]}]) +((,[[:space:]]+|[^[:space:]<])+)/\1 \3 \2/' async.html test.html
+ sed -E -i .orig '/<p>/,/<\/p>/ s/(@param|@property) +((,[[:space:]]+|[^[:space:]<])+)/\1 <code>\2<\/code>/' async.html test.html
+ sed -E -i .orig '/<p>/,/<\/p>/ s/(@param|@property|@return) ([^[{]*)[[{]([^[:space:]]+)[]}]/\1 \2<i>\3<\/i>/' async.html test.html
+ sed -E -i .orig '/<p>/,/<\/p>/ s/@(api|abstract|author|concern|copyright|deprecated|example|extend|include|note|method|mixin|option|overload|param|private|return|see|since|todo|version|author|constructor|deprecated|exception|param|private|property|return|see|this|throws|version)/<b>\1<\/b>/' async.html test.html
+ rm async.html.orig test.html.orig
+ echo '.doc-tag { color: #777; }'
+ echo '.doc-tag * { color: #222; }'
+ echo Done.
Done.```

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

No branches or pull requests

1 participant