yiisoft / yii2-apidoc

Yii 2 apidoc extension.
https://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
258 stars 121 forks source link

Convert newlines to spaces and consider the first sentence ended only if the dot is followed by a space in `BaseDoc::extractFirstSentence()` #282

Closed WinterSilence closed 2 years ago

WinterSilence commented 2 years ago

source comment:

a URI [RFC3986](https://tools.ietf.org/html/rfc3986) or
URI template [RFC6570](https://tools.ietf.org/html/rfc6570). This property is required.

before fix BaseDoc::extractFirstSentence() return: a URI [RFC3986](https://tools. after: a URI [RFC3986](https://tools.ietf.org/html/rfc3986) or URI template [RFC6570](https://tools.ietf.org/html/rfc6570). is dirty fix, but covering main cases

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Fixed issues

Minor additions for historical purposes by @arogachev.

Newline (only affects HTML code, not visual output):

https://github.com/yiisoft/yii2/blob/2874e070f3ad88c727b1335ba4f4515855bf5f64/framework/base/Controller.php#L48-L52

Screenshot 2022-03-29 at 11-54-27 Controller yii_base_Controller

No space after dot:

Screenshot 2022-03-29 at 11-49-16 Link yii_web_Link

arogachev commented 2 years ago

Thanks, it's actually 2 fixes in 1, also handles newlines. :+1:

WinterSilence commented 2 years ago

@arogachev That's method still incorrect. We can detect summary only by first \n\n, but Yii2 don't use PSR-5.

arogachev commented 2 years ago

@WinterSilence Thanks. Moved it to a separate issue for now - #283.

arogachev commented 2 years ago

@WinterSilence Thanks for your contribution! :+1: I additionally checked how it affects current API docs using diffs, didn't find any regression. Need to prepare new release now.

WinterSilence commented 2 years ago

@arogachev меня удивляет, что такой популярный и, вышедший много лет назад, фреймворк до сих пор настолько сырой