https://github.com/theopencms/the_string_addon
Some helper methods for String class
https://github.com/theopencms/the_string_addon
Last synced: over 1 year ago
JSON representation
Some helper methods for String class
- Host: GitHub
- URL: https://github.com/theopencms/the_string_addon
- Owner: TheOpenCMS
- License: mit
- Created: 2017-05-31T19:07:37.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-30T19:08:21.000Z (almost 9 years ago)
- Last Synced: 2025-01-16T09:40:00.835Z (over 1 year ago)
- Language: Ruby
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
### TheStringAddon
```
txt = txt.to_s
# Sanitize and empty lines process
txt = sanitize_for(txt, current_user)
txt = txt.empty_p2br
# MarkDown + Code Hightlight
txt = ::Markdown2Tags.process(txt)
txt = ::ColoredCode.with_pygments(txt)
# AutoLink
al_helper = ::AutoLink.new
txt = al_helper.auto_link(txt, sanitize: false, html: { target: :_blank, rel: :nofollow })
# Protect content of external links
txt = txt.add_nofollow_to_links if !current_user.admin?
txt = txt.wrap_nofollow_links_with_noindex
txt.strip
```
```
## Hello World
### Hello World
#### Hello World
*ITALIC*
**BOLD**
~~DELETED~~
_UNDERLINE_
==highlighted==
2(nd)
[Текст ссылки](адрес://ссылки.здесь "Заголовок ссылки")
foo_bar_baz
```python
# more python code
```
```