Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#37718 closed enhancement (fixed)

word-count.js documentation

Reported by: jipmoors's profile jipmoors Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.7 Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: javascript, docs Cc:

Description

Added documentation to the word-count.js file.
Especially interesting are the obscure characters and character-ranges used in the regular expressions.

This patch was a joined effort of myself and andizer.

No functionality has been altered.

Attachments (2)

word-count.patch (6.8 KB) - added by jipmoors 8 years ago.
word-count.js documented
word-count.v2.patch (8.7 KB) - added by jipmoors 8 years ago.
Added newlines before comments and converted multiple lines to multi-line comment block.

Download all attachments as: .zip

Change History (8)

@jipmoors
8 years ago

word-count.js documented

#1 @obenland
8 years ago

  • Component changed from Administration to Editor
  • Milestone changed from Awaiting Review to 4.7
  • Type changed from defect (bug) to enhancement

IANDE (I Am No Documentation Expert), but I think all comments should be preceded by a blank line, at least that's what wpcs keeps telling me.

#2 @adamsilverstein
8 years ago

Great work here @jipmoors thanks for taking this on - the lack of documentation in these older JS files is sorely in need of addressing. I agree the extra space before comment lines would be helpful and inline with standards.

@jipmoors
8 years ago

Added newlines before comments and converted multiple lines to multi-line comment block.

#3 @jipmoors
8 years ago

While going over the file to apply the new lines above comments I noticed some minor improvements.

It felt a bit strange to put new lines in the comments on the list of regular expressions being defined, I guess the consistency break between items in the list bugged me a bit.

I guess the clarity of where the comment belongs to wins in regard to consistency, I was reluctant to add comments above every entry to balance it out the other way around.

Please give props to andizer as well (as mentioned before).
Noting here explicitly because he was forgotten in 37717.

#4 @wonderboymusic
8 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 38358:

Editor: improve word-count.js documentation.

Props jipmoors, andizer.
Fixes #37718.

#5 @SergeyBiryukov
8 years ago

In 39739:

Docs: Use 3-digit, x.x.x style semantic versioning for @since entries in wp-admin/js/word-count.js.

See #37718.

#6 @adamsilverstein
8 years ago

Thanks @SergeyBiryukov!

Note: See TracTickets for help on using tickets.