├── .bowerrc ├── .gitignore ├── LICENSE ├── README.md ├── bower.json ├── build.gradle ├── docker-compose.yml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── releases └── myblog.service ├── settings.gradle └── src └── main ├── java └── com │ └── raysmond │ └── blog │ ├── Application.java │ ├── Constants.java │ ├── JpaConfig.java │ ├── SecurityConfig.java │ ├── WebConfig.java │ ├── admin │ └── controllers │ │ ├── AdminController.java │ │ ├── NotificatorController.java │ │ ├── PostController.java │ │ ├── SeoRobotAgentController.java │ │ ├── StatisticsController.java │ │ ├── StoredFileController.java │ │ └── UserController.java │ ├── controllers │ ├── HomeController.java │ ├── PostController.java │ ├── StoredFileController.java │ ├── SympathyController.java │ ├── TagController.java │ └── UserController.java │ ├── error │ ├── ExceptionHandlerController.java │ └── NotFoundException.java │ ├── forms │ ├── LikeForm.java │ ├── PostForm.java │ ├── PostPreviewForm.java │ ├── SeoRobotAgentForm.java │ ├── SettingsForm.java │ ├── StoredFileForm.java │ └── UserForm.java │ ├── models │ ├── BaseModel.java │ ├── Like.java │ ├── Post.java │ ├── SeoPostData.java │ ├── SeoRobotAgent.java │ ├── Setting.java │ ├── StoredFile.java │ ├── Tag.java │ ├── User.java │ ├── Visit.java │ ├── dto │ │ ├── AjaxAnswerDTO.java │ │ ├── PostAnnouncementDTO.java │ │ ├── PostIdTitleDTO.java │ │ ├── PostPreviewDTO.java │ │ ├── PostsIdListDTO.java │ │ ├── VisitStatDTO.java │ │ └── VisitsStatsChartDTO.java │ └── support │ │ ├── OgLocale.java │ │ ├── OgType.java │ │ ├── PostFormat.java │ │ ├── PostStatus.java │ │ ├── PostType.java │ │ └── WebError.java │ ├── notificators │ ├── Notificator.java │ └── telegram │ │ └── TelegramBotManager.java │ ├── repositories │ ├── LikeRepository.java │ ├── PostRepository.java │ ├── SeoPostDataRepository.java │ ├── SeoRobotAgentRepository.java │ ├── SettingRepository.java │ ├── StoredFileRepository.java │ ├── TagRepository.java │ ├── UserRepository.java │ └── VisitRepository.java │ ├── seo │ └── controllers │ │ └── SitemapController.java │ ├── services │ ├── AdsConfig.java │ ├── AppSetting.java │ ├── CacheSettingService.java │ ├── FileStorageService.java │ ├── LikeService.java │ ├── PostService.java │ ├── RequestProcessorService.java │ ├── SeoRobotAgentService.java │ ├── SeoService.java │ ├── SettingService.java │ ├── StatisticsService.java │ ├── TagService.java │ ├── TelegramBotSettings.java │ ├── UserService.java │ └── VisitService.java │ ├── support │ └── web │ │ ├── FlexmarkMarkdownService.java │ │ ├── HttpContentTypeSerializer.java │ │ ├── MarkdownService.java │ │ ├── Message.java │ │ ├── MessageHelper.java │ │ ├── SyntaxHighlightService.java │ │ ├── ViewHelper.java │ │ └── extensions │ │ └── YoutubeLinkTransformer.java │ └── utils │ ├── CommonHelper.java │ ├── DTOUtil.java │ └── PaginatorUtil.java └── resources ├── application-mysql.yml ├── application-production.yml ├── application.yml ├── i18n └── messages.properties ├── logback.xml ├── queries └── visits.sql ├── resources ├── css │ ├── admin │ │ └── admin.css │ ├── modal.css │ ├── mystyle.css │ ├── theme-light.css │ └── theme.css ├── images │ ├── dislike.png │ ├── dislike_min.png │ ├── icon_error.svg │ ├── like.png │ ├── like_min.png │ ├── loading.gif │ ├── open-eye-with-blank-pupil.png │ └── open-eye-with-blank-pupil_min.png └── vendors │ ├── bootstrap-paginator-1.0.2 │ ├── LICENSE │ ├── README.md │ └── js │ │ └── bootstrap-paginator.min.js │ ├── marked-0.3.6 │ ├── .gitignore │ ├── .npmignore │ ├── .travis.yml │ ├── Gulpfile.js │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── bower.json │ ├── component.json │ ├── doc │ │ ├── broken.md │ │ └── todo.md │ ├── index.js │ ├── lib │ │ └── marked.js │ ├── man │ │ └── marked.1 │ ├── marked.min.js │ ├── package.json │ └── test │ │ ├── README │ │ ├── browser │ │ ├── index.html │ │ ├── index.js │ │ └── test.js │ │ ├── index.js │ │ ├── new │ │ ├── autolink_lines.html │ │ ├── autolink_lines.text │ │ ├── blockquote_list_item.html │ │ ├── blockquote_list_item.text │ │ ├── case_insensitive_refs.html │ │ ├── case_insensitive_refs.text │ │ ├── def_blocks.html │ │ ├── def_blocks.text │ │ ├── double_link.html │ │ ├── double_link.text │ │ ├── escaped_angles.html │ │ ├── escaped_angles.text │ │ ├── gfm_break.breaks.html │ │ ├── gfm_break.breaks.text │ │ ├── gfm_code.html │ │ ├── gfm_code.text │ │ ├── gfm_code_hr_list.html │ │ ├── gfm_code_hr_list.text │ │ ├── gfm_del.html │ │ ├── gfm_del.text │ │ ├── gfm_em.html │ │ ├── gfm_em.text │ │ ├── gfm_hashtag.gfm.html │ │ ├── gfm_hashtag.gfm.text │ │ ├── gfm_hashtag.nogfm.html │ │ ├── gfm_hashtag.nogfm.text │ │ ├── gfm_links.html │ │ ├── gfm_links.text │ │ ├── gfm_tables.html │ │ ├── gfm_tables.text │ │ ├── hr_list_break.html │ │ ├── hr_list_break.text │ │ ├── lazy_blockquotes.html │ │ ├── lazy_blockquotes.text │ │ ├── list_item_text.html │ │ ├── list_item_text.text │ │ ├── loose_lists.html │ │ ├── loose_lists.text │ │ ├── main.html │ │ ├── main.text │ │ ├── nested_code.html │ │ ├── nested_code.text │ │ ├── nested_em.html │ │ ├── nested_em.text │ │ ├── nested_square_link.html │ │ ├── nested_square_link.text │ │ ├── not_a_link.html │ │ ├── not_a_link.text │ │ ├── ref_paren.html │ │ ├── ref_paren.text │ │ ├── same_bullet.html │ │ ├── same_bullet.text │ │ ├── text.smartypants.html │ │ ├── text.smartypants.text │ │ ├── toplevel_paragraphs.gfm.html │ │ ├── toplevel_paragraphs.gfm.text │ │ ├── tricky_list.html │ │ └── tricky_list.text │ │ ├── original │ │ ├── amps_and_angles_encoding.html │ │ ├── amps_and_angles_encoding.text │ │ ├── auto_links.html │ │ ├── auto_links.text │ │ ├── backslash_escapes.html │ │ ├── backslash_escapes.text │ │ ├── blockquotes_with_code_blocks.html │ │ ├── blockquotes_with_code_blocks.text │ │ ├── code_blocks.html │ │ ├── code_blocks.text │ │ ├── code_spans.html │ │ ├── code_spans.text │ │ ├── hard_wrapped_paragraphs_with_list_like_lines.html │ │ ├── hard_wrapped_paragraphs_with_list_like_lines.text │ │ ├── horizontal_rules.html │ │ ├── horizontal_rules.text │ │ ├── inline_html_advanced.html │ │ ├── inline_html_advanced.text │ │ ├── inline_html_comments.html │ │ ├── inline_html_comments.text │ │ ├── inline_html_simple.html │ │ ├── inline_html_simple.text │ │ ├── links_inline_style.html │ │ ├── links_inline_style.text │ │ ├── links_reference_style.html │ │ ├── links_reference_style.text │ │ ├── links_shortcut_references.html │ │ ├── links_shortcut_references.text │ │ ├── literal_quotes_in_titles.html │ │ ├── literal_quotes_in_titles.text │ │ ├── markdown_documentation_basics.html │ │ ├── markdown_documentation_basics.text │ │ ├── markdown_documentation_syntax.html │ │ ├── markdown_documentation_syntax.text │ │ ├── nested_blockquotes.html │ │ ├── nested_blockquotes.text │ │ ├── ordered_and_unordered_lists.html │ │ ├── ordered_and_unordered_lists.text │ │ ├── strong_and_em_together.html │ │ ├── strong_and_em_together.text │ │ ├── tabs.html │ │ ├── tabs.text │ │ ├── tidyness.html │ │ └── tidyness.text │ │ └── tests │ │ ├── amps_and_angles_encoding.html │ │ ├── amps_and_angles_encoding.text │ │ ├── auto_links.html │ │ ├── auto_links.text │ │ ├── autolink_lines.html │ │ ├── autolink_lines.text │ │ ├── backslash_escapes.html │ │ ├── backslash_escapes.text │ │ ├── blockquote_list_item.html │ │ ├── blockquote_list_item.text │ │ ├── blockquotes_with_code_blocks.html │ │ ├── blockquotes_with_code_blocks.text │ │ ├── case_insensitive_refs.html │ │ ├── case_insensitive_refs.text │ │ ├── code_blocks.html │ │ ├── code_blocks.text │ │ ├── code_spans.html │ │ ├── code_spans.text │ │ ├── def_blocks.html │ │ ├── def_blocks.text │ │ ├── double_link.html │ │ ├── double_link.text │ │ ├── escaped_angles.html │ │ ├── escaped_angles.text │ │ ├── gfm_break.breaks.html │ │ ├── gfm_break.breaks.text │ │ ├── gfm_code.html │ │ ├── gfm_code.text │ │ ├── gfm_code_hr_list.html │ │ ├── gfm_code_hr_list.text │ │ ├── gfm_del.html │ │ ├── gfm_del.text │ │ ├── gfm_em.html │ │ ├── gfm_em.text │ │ ├── gfm_hashtag.gfm.html │ │ ├── gfm_hashtag.gfm.text │ │ ├── gfm_hashtag.nogfm.html │ │ ├── gfm_hashtag.nogfm.text │ │ ├── gfm_links.html │ │ ├── gfm_links.text │ │ ├── gfm_tables.html │ │ ├── gfm_tables.text │ │ ├── hard_wrapped_paragraphs_with_list_like_lines.nogfm.html │ │ ├── hard_wrapped_paragraphs_with_list_like_lines.nogfm.text │ │ ├── horizontal_rules.html │ │ ├── horizontal_rules.text │ │ ├── hr_list_break.html │ │ ├── hr_list_break.text │ │ ├── inline_html_advanced.html │ │ ├── inline_html_advanced.text │ │ ├── inline_html_comments.html │ │ ├── inline_html_comments.text │ │ ├── inline_html_simple.html │ │ ├── inline_html_simple.text │ │ ├── lazy_blockquotes.html │ │ ├── lazy_blockquotes.text │ │ ├── links.sanitize.html │ │ ├── links.sanitize.text │ │ ├── links_inline_style.html │ │ ├── links_inline_style.text │ │ ├── links_reference_style.html │ │ ├── links_reference_style.text │ │ ├── links_shortcut_references.html │ │ ├── links_shortcut_references.text │ │ ├── list_item_text.html │ │ ├── list_item_text.text │ │ ├── literal_quotes_in_titles.html │ │ ├── literal_quotes_in_titles.text │ │ ├── loose_lists.html │ │ ├── loose_lists.text │ │ ├── main.html │ │ ├── main.text │ │ ├── markdown_documentation_basics.html │ │ ├── markdown_documentation_basics.text │ │ ├── markdown_documentation_syntax.html │ │ ├── markdown_documentation_syntax.text │ │ ├── nested_blockquotes.html │ │ ├── nested_blockquotes.text │ │ ├── nested_code.html │ │ ├── nested_code.text │ │ ├── nested_em.html │ │ ├── nested_em.text │ │ ├── nested_square_link.html │ │ ├── nested_square_link.text │ │ ├── not_a_link.html │ │ ├── not_a_link.text │ │ ├── ordered_and_unordered_lists.html │ │ ├── ordered_and_unordered_lists.text │ │ ├── ref_paren.html │ │ ├── ref_paren.text │ │ ├── same_bullet.html │ │ ├── same_bullet.text │ │ ├── strong_and_em_together.html │ │ ├── strong_and_em_together.text │ │ ├── tabs.html │ │ ├── tabs.text │ │ ├── text.smartypants.html │ │ ├── text.smartypants.text │ │ ├── tidyness.html │ │ ├── tidyness.text │ │ ├── toplevel_paragraphs.gfm.html │ │ ├── toplevel_paragraphs.gfm.text │ │ ├── tricky_list.html │ │ └── tricky_list.text │ ├── prism │ ├── prism.css │ └── prism.js │ ├── pygments │ ├── github.css │ └── monokai.css │ ├── simditor-2.3.6 │ ├── images │ │ └── image.png │ └── styles │ │ ├── editor.scss │ │ ├── fonticon.scss │ │ ├── simditor.css │ │ └── simditor.scss │ ├── simditor-markdown │ ├── lib │ │ └── simditor-markdown.js │ └── styles │ │ └── simditor-markdown.css │ ├── to-markdown-3.1.0 │ ├── .bowerrc │ ├── .editorconfig │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── bower.json │ ├── dist │ │ └── to-markdown.js │ ├── index.js │ ├── lib │ │ ├── gfm-converters.js │ │ ├── html-parser.js │ │ └── md-converters.js │ ├── package.json │ ├── test │ │ ├── gfm-test.js │ │ ├── index.html │ │ └── to-markdown-test.js │ └── testem.yml │ └── typo.css-2.1.2 │ ├── .gitignore │ ├── README.md │ ├── license.txt │ ├── typo.css │ ├── typo.html │ └── typo.min.css ├── static ├── favicon.ico └── robots.txt └── templates ├── admin ├── files │ ├── edit.jade │ ├── fragments │ │ ├── fileUploadForm.jade │ │ ├── list.jade │ │ └── paginator.jade │ ├── index.jade │ └── status.jade ├── home │ ├── index.jade │ └── settings.jade ├── layout │ ├── admin.jade │ ├── footer.jade │ ├── head.jade │ ├── message.jade │ └── navbar.jade ├── posts │ ├── edit.jade │ ├── fragments │ │ └── paginator.jade │ ├── index.jade │ └── new.jade ├── robotsAgents │ ├── edit.jade │ ├── fragments │ │ └── seoRobotAgentForm.jade │ └── index.jade └── users │ └── profile.jade ├── error.jade ├── error └── general.jade ├── fragments ├── disqus.jade ├── ga.jade └── ya-metrics.jade ├── home ├── about.jade └── index.jade ├── layout ├── app.jade ├── footer.jade ├── head.jade ├── navbar.jade └── top.jade ├── posts ├── archive.jade ├── fragments │ ├── paginator.jade │ ├── social.jade │ └── socialReadonly.jade ├── index.jade ├── projects.jade └── show.jade ├── tags ├── index.jade └── show.jade └── users └── signin.jade /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "src/main/resources/resources/bower_components" 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | bin 5 | scripts 6 | classes 7 | out 8 | production_app.properties 9 | *.iml 10 | *.ipr 11 | *.iws 12 | src/main/resources/resources/bower_components 13 | temp 14 | private 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Jiankun LEI; 2017, Vyacheslav Boyko (bvn13) 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of rumps nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without 16 | specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "springblog", 3 | "version": "0.0.0", 4 | "appPath": "src/main/resources", 5 | "testPath": "src/test/javascript/spec", 6 | "dependencies": { 7 | "jquery": "2.1.4", 8 | "marked": "0.3.5", 9 | "simple-module": "2.0.6", 10 | "simple-hotkeys": "1.0.3", 11 | "simditor": "2.3.5", 12 | "simditor-markdown": "1.1.2", 13 | "to-markdown": "1.3.0", 14 | "adminlte": "2.3.6" 15 | }, 16 | "devDependencies": {} 17 | } 18 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | mysql: 4 | image: mysql 5 | hostname: mysql 6 | environment: 7 | - MYSQL_USER=root 8 | - MYSQL_DATABASE=spring_blog 9 | - MYSQL_ROOT_PASSWORD=123456 10 | webapp: 11 | image: java:8 12 | links: 13 | - mysql:mysql 14 | # - redis:redis 15 | volumes: 16 | - ./build/libs/SpringBlog-0.1.jar:/app/app.jar 17 | ports: 18 | - "9000:9000" 19 | command: "java -jar /app/app.jar --spring.profiles.active=dev" 20 | 21 | # redis: 22 | # image: redis 23 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bvn13/SpringBlog/d3f35ea86c6859e583b86ee00259d8650c1a99e8/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /releases/myblog.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=MyBlog 3 | After=syslog.target 4 | 5 | [Service] 6 | User=bvn13 7 | #ExecStart=/home/bvn13/dev/blog/myblog.sh 8 | ExecStart=/usr/bin/java -jar /home/bvn13/dev/blog/SpringBlog-2.6.1.jar --spring.config.location=application-production.yml 9 | SuccessExitStatus=143 10 | 11 | [Install] 12 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'SpringBlog' -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/Application.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog; 2 | 3 | import org.slf4j.bridge.SLF4JBridgeHandler; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | 8 | /** 9 | * @author Raysmond 10 | */ 11 | @SpringBootApplication 12 | // 开启缓存请把下行取消注释 13 | // Open the cache Please uncomment the downlink 14 | //@EnableCaching 15 | public class Application { 16 | 17 | public static void main(String[] args) { 18 | SLF4JBridgeHandler.removeHandlersForRootLogger(); 19 | SLF4JBridgeHandler.install(); 20 | 21 | SpringApplication.run(Application.class, args); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/Constants.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog; 2 | 3 | /** 4 | * @author: Raysmond 5 | */ 6 | public final class Constants { 7 | 8 | public static final String ENV_PRODUCTION = "production"; 9 | 10 | public static final String ENV_DEVELOPMENT = "development"; 11 | 12 | public static final String DEFAULT_ADMIN_EMAIL = "admin@admin.com"; 13 | 14 | public static final String DEFAULT_ADMIN_PASSWORD = "admin"; 15 | 16 | public static final String ABOUT_PAGE_PERMALINK = "about"; 17 | 18 | public static final String PROJECTS_PAGE_PERMALINK = "projects"; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/admin/controllers/NotificatorController.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.admin.controllers; 2 | 3 | import com.raysmond.blog.models.Post; 4 | import com.raysmond.blog.models.dto.PostAnnouncementDTO; 5 | import com.raysmond.blog.models.support.PostStatus; 6 | import com.raysmond.blog.notificators.Notificator; 7 | import com.raysmond.blog.services.PostService; 8 | import lombok.extern.slf4j.Slf4j; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.http.MediaType; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.ui.Model; 13 | import org.springframework.web.bind.annotation.PathVariable; 14 | import org.springframework.web.bind.annotation.PostMapping; 15 | import org.springframework.web.bind.annotation.RequestMapping; 16 | import org.springframework.web.bind.annotation.ResponseBody; 17 | import org.telegram.telegrambots.meta.exceptions.TelegramApiException; 18 | 19 | /** 20 | * Created by bvn13 on 22.12.2017. 21 | */ 22 | @Slf4j 23 | @Controller 24 | @RequestMapping(value = "/admin/notify") 25 | public class NotificatorController { 26 | 27 | @Autowired 28 | private Notificator notificator; 29 | 30 | 31 | @Autowired 32 | private PostService postService; 33 | 34 | 35 | 36 | @PostMapping(value = "/{postId:[0-9]+}/telegram", produces = MediaType.APPLICATION_JSON_VALUE) 37 | public @ResponseBody PostAnnouncementDTO sendTelegramAnnounce(@PathVariable Long postId) { 38 | 39 | Post post = postService.getPost(postId); 40 | if (post.getPostStatus().equals(PostStatus.PUBLISHED)) { 41 | try { 42 | notificator.announcePost(post); 43 | return new PostAnnouncementDTO(false); 44 | } catch (Exception e) { 45 | log.error("Error", e); 46 | return new PostAnnouncementDTO(true, ""+e.getMessage()); 47 | } 48 | } else { 49 | return new PostAnnouncementDTO(true, "Post is not published!"); 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/admin/controllers/StatisticsController.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.admin.controllers; 2 | 3 | import com.raysmond.blog.models.dto.PostsIdListDTO; 4 | import com.raysmond.blog.models.dto.VisitsStatsChartDTO; 5 | import com.raysmond.blog.services.StatisticsService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | import org.springframework.http.MediaType; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | import java.util.Date; 14 | 15 | /** 16 | * Created by bvn13 on 20.12.2017. 17 | */ 18 | @Controller 19 | @RequestMapping(value = "/admin/stats") 20 | public class StatisticsController { 21 | 22 | @Autowired 23 | private StatisticsService statisticsService; 24 | 25 | 26 | @GetMapping(value = "/visits", produces = MediaType.APPLICATION_JSON_VALUE) 27 | public @ResponseBody VisitsStatsChartDTO getVisitsChart() { 28 | VisitsStatsChartDTO chart = statisticsService.getFullVisitsStatsChartData(); 29 | return chart; 30 | } 31 | 32 | @PostMapping(value = "/visits", produces = MediaType.APPLICATION_JSON_VALUE) 33 | public @ResponseBody VisitsStatsChartDTO getVisitsChartByPeriodAndPostsIdList( 34 | @RequestParam @DateTimeFormat(pattern="dd-MM-yyyy") Date start, 35 | @RequestParam @DateTimeFormat(pattern="dd-MM-yyyy") Date end, 36 | @RequestBody PostsIdListDTO postsDto) 37 | { 38 | VisitsStatsChartDTO chart = statisticsService.getChartDataByPeriodAndPostsList(start, end, postsDto.getIds()); 39 | return chart; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/error/NotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.error; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | /** 7 | * @author Raysmond 8 | */ 9 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 10 | public final class NotFoundException extends RuntimeException { 11 | private String message; 12 | 13 | public NotFoundException(){ 14 | 15 | } 16 | 17 | public NotFoundException(String message){ 18 | this.message = message; 19 | } 20 | 21 | @Override 22 | public String getMessage(){ 23 | return message; 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/forms/LikeForm.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.forms; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotNull; 6 | 7 | @Data 8 | public class LikeForm { 9 | 10 | @NotNull 11 | private String sympathy = "0"; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/forms/PostPreviewForm.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.forms; 2 | 3 | import lombok.Data; 4 | import org.hibernate.validator.constraints.NotEmpty; 5 | 6 | /** 7 | * Created by bvn13 on 28.01.2018. 8 | */ 9 | @Data 10 | public class PostPreviewForm { 11 | 12 | @NotEmpty 13 | private String content; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/forms/SeoRobotAgentForm.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.forms; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotNull; 6 | 7 | @Data 8 | public class SeoRobotAgentForm { 9 | 10 | @NotNull 11 | private Long id = 0L; 12 | 13 | @NotNull 14 | private String userAgent = ""; 15 | 16 | @NotNull 17 | private Boolean isRegexp = false; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/forms/SettingsForm.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.forms; 2 | 3 | import lombok.Data; 4 | import org.hibernate.validator.constraints.NotEmpty; 5 | 6 | import javax.validation.constraints.NotNull; 7 | 8 | /** 9 | * @author Raysmond 10 | */ 11 | @Data 12 | public class SettingsForm { 13 | 14 | @NotEmpty 15 | @NotNull 16 | private String siteName; 17 | 18 | @NotNull 19 | private String siteSlogan; 20 | 21 | @NotNull 22 | private Integer pageSize; 23 | 24 | @NotNull 25 | private String storagePath; 26 | 27 | @NotNull 28 | private String mainUri; 29 | 30 | @NotNull 31 | private String telegramMasterChatId; 32 | 33 | @NotNull 34 | private String subscriptionLink; 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/forms/StoredFileForm.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.forms; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotNull; 6 | 7 | @Data 8 | public class StoredFileForm { 9 | 10 | @NotNull 11 | private String title; 12 | 13 | @NotNull 14 | private String name; 15 | 16 | @NotNull 17 | private String path; 18 | 19 | @NotNull 20 | private Long size; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/forms/UserForm.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.forms; 2 | 3 | import lombok.Data; 4 | 5 | import javax.validation.constraints.NotNull; 6 | 7 | /** 8 | * @author Raysmond. 9 | */ 10 | @Data 11 | public class UserForm { 12 | @NotNull 13 | private String password; 14 | 15 | @NotNull 16 | private String newPassword; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/BaseModel.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models; 2 | 3 | import org.apache.commons.lang3.builder.HashCodeBuilder; 4 | import javax.persistence.*; 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * An abstract base model class for entities 10 | * 11 | * @author Raysmond 12 | */ 13 | @MappedSuperclass 14 | public abstract class BaseModel implements Comparable, Serializable { 15 | 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.IDENTITY) 18 | @Column(name = "id") 19 | private Long id; 20 | 21 | @Column(nullable = false) 22 | private Date createdAt; 23 | 24 | @Column(nullable = false) 25 | private Date updatedAt; 26 | 27 | @PrePersist 28 | public void prePersist(){ 29 | createdAt = updatedAt = new Date(); 30 | } 31 | 32 | @PreUpdate 33 | public void preUpdate(){ 34 | updatedAt = new Date(); 35 | } 36 | 37 | @Override 38 | public int compareTo(BaseModel o) { 39 | return this.getId().compareTo(o.getId()); 40 | } 41 | 42 | public boolean equals(Object other) { 43 | if (other == null || other.getClass() != this.getClass()) 44 | return false; 45 | 46 | return this.getId().equals(((BaseModel) other).getId()); 47 | } 48 | 49 | 50 | public int hashCode() { 51 | return new HashCodeBuilder().append(getId()).toHashCode(); 52 | } 53 | 54 | 55 | public Long getId() { 56 | return id; 57 | } 58 | 59 | public void setId(Long _id) { 60 | id = _id; 61 | } 62 | 63 | public Date getCreatedAt() { 64 | return createdAt; 65 | } 66 | 67 | public void setCreatedAt(Date createdAt) { 68 | this.createdAt = createdAt; 69 | } 70 | 71 | public Date getUpdatedAt() { 72 | return updatedAt; 73 | } 74 | 75 | public void setUpdatedAt(Date updatedAt) { 76 | this.updatedAt = updatedAt; 77 | } 78 | 79 | } -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/Like.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.ManyToOne; 9 | import javax.persistence.Table; 10 | 11 | @Entity 12 | @Table(name = "posts_likes") 13 | @Getter @Setter 14 | public class Like extends BaseModel { 15 | 16 | @ManyToOne 17 | private User user; 18 | 19 | @ManyToOne 20 | private Post post; 21 | 22 | @Column(nullable = false) 23 | private Integer sympathy; 24 | 25 | @Column(nullable = false) 26 | private String clientIp; 27 | 28 | @Column(nullable = false, columnDefinition = "boolean default false") 29 | private Boolean isAdmin; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/SeoPostData.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models; 2 | 3 | import com.raysmond.blog.models.support.OgLocale; 4 | import com.raysmond.blog.models.support.OgType; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | import javax.persistence.*; 9 | 10 | @Entity 11 | @Table(name = "seo_posts_data") 12 | @Getter 13 | @Setter 14 | public class SeoPostData extends BaseModel { 15 | 16 | @OneToOne(fetch = FetchType.LAZY, mappedBy = "seoData", cascade = CascadeType.ALL) 17 | private Post post; 18 | 19 | @Column 20 | private String ogTitle = ""; 21 | 22 | @Column 23 | @Enumerated(EnumType.STRING) 24 | private OgType ogType = OgType.ARTICLE; 25 | 26 | @Column 27 | private String ogImage = ""; 28 | 29 | @Column 30 | private String ogVideo = ""; 31 | 32 | @Column 33 | @Enumerated(EnumType.STRING) 34 | private OgLocale ogLocale = OgLocale.en_EN; 35 | 36 | /*@Column 37 | private String ogUrl; 38 | 39 | @Column 40 | private String ogDescription;*/ 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/SeoRobotAgent.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import javax.persistence.*; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | @Entity 11 | @Table(name = "seo_robots_agents") 12 | @Getter 13 | @Setter 14 | public class SeoRobotAgent extends BaseModel { 15 | 16 | @Column(nullable = false) 17 | private String userAgent; 18 | 19 | @Column(nullable = false, columnDefinition = "boolean default false") 20 | private Boolean isRegexp; 21 | 22 | public SeoRobotAgent() { 23 | 24 | } 25 | 26 | public SeoRobotAgent(String userAgent) { 27 | this.userAgent = userAgent; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/Setting.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models; 2 | 3 | import lombok.Builder; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import javax.persistence.*; 8 | import java.io.Serializable; 9 | import java.util.Date; 10 | 11 | /** 12 | * A generic setting model 13 | * 14 | * @author Raysmond 15 | */ 16 | @Entity 17 | @Table(name = "settings") 18 | @Getter @Setter 19 | public class Setting extends BaseModel{ 20 | 21 | @Column(name = "_key", unique = true, nullable = false) 22 | private String key; 23 | 24 | @Lob 25 | @Column(name = "_value") 26 | private Serializable value; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/Tag.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import javax.persistence.*; 7 | import java.util.ArrayList; 8 | import java.util.Collection; 9 | import java.util.List; 10 | 11 | /** 12 | * @author Raysmond. 13 | */ 14 | @Entity 15 | @Table(name = "tags") 16 | @Getter @Setter 17 | public class Tag extends BaseModel { 18 | 19 | @Column(nullable = false, unique = true) 20 | private String name; 21 | 22 | @ManyToMany(fetch = FetchType.LAZY, mappedBy = "tags") 23 | private List posts = new ArrayList<>(); 24 | 25 | public Tag(){ 26 | 27 | } 28 | 29 | public Tag(String name){ 30 | this.setName(name); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/User.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models; 2 | 3 | import javax.persistence.*; 4 | 5 | import com.fasterxml.jackson.annotation.JsonIgnore; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | import java.util.ArrayList; 10 | import java.util.Collection; 11 | 12 | /** 13 | * @author Raysmond 14 | */ 15 | @Entity 16 | @Table(name = "users") 17 | @Getter @Setter 18 | public class User extends BaseModel { 19 | public static final String ROLE_ADMIN = "ROLE_ADMIN"; 20 | public static final String ROLE_USER = "ROLE_USER"; 21 | 22 | @Column(unique = true) 23 | private String email; 24 | 25 | @JsonIgnore 26 | private String password; 27 | 28 | private String role = ROLE_USER; 29 | 30 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "user", cascade = CascadeType.REMOVE) 31 | private Collection posts = new ArrayList<>(); 32 | 33 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "user", cascade = CascadeType.REMOVE) 34 | private Collection storedFiles = new ArrayList<>(); 35 | 36 | public User() { 37 | 38 | } 39 | 40 | public Boolean isAdmin() { 41 | return this.role.equals(ROLE_ADMIN); 42 | } 43 | 44 | public User(String email, String password, String role) { 45 | this.email = email; 46 | this.password = password; 47 | this.role = role; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/Visit.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import javax.persistence.*; 7 | import java.util.HashSet; 8 | import java.util.Set; 9 | 10 | @Entity 11 | @Table(name = "visits") 12 | @Getter @Setter 13 | public class Visit extends BaseModel { 14 | 15 | @ManyToOne 16 | private User user; 17 | 18 | @Column(nullable = false) 19 | private String clientIp; 20 | 21 | @ManyToOne 22 | private Post post; 23 | 24 | @Column(nullable = false, columnDefinition = "boolean default false") 25 | private Boolean isAdmin; 26 | 27 | @Column(columnDefinition = "VARCHAR") 28 | private String userAgent; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/dto/AjaxAnswerDTO.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * Created by bvn13 on 22.12.2017. 10 | */ 11 | @Data 12 | @AllArgsConstructor 13 | public class AjaxAnswerDTO implements Serializable { 14 | 15 | private Boolean error; 16 | private String message; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/dto/PostAnnouncementDTO.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models.dto; 2 | 3 | /** 4 | * Created by bvn13 on 22.12.2017. 5 | */ 6 | public class PostAnnouncementDTO extends AjaxAnswerDTO { 7 | public PostAnnouncementDTO(Boolean error, String message) { 8 | super(error, message); 9 | } 10 | public PostAnnouncementDTO(Boolean error) { 11 | super(error, ""); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/dto/PostIdTitleDTO.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | /** 7 | * Created by bvn13 on 25.12.2017. 8 | */ 9 | @Data 10 | @AllArgsConstructor 11 | public class PostIdTitleDTO { 12 | private Long id; 13 | private String title; 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/dto/PostPreviewDTO.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | /** 7 | * Created by bvn13 on 28.01.2018. 8 | */ 9 | @Data 10 | @AllArgsConstructor 11 | public class PostPreviewDTO { 12 | 13 | private String content; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/dto/PostsIdListDTO.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by bvn13 on 25.12.2017. 9 | */ 10 | @Data 11 | public class PostsIdListDTO { 12 | private List ids; 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/dto/VisitStatDTO.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | 8 | /** 9 | * Created by bvn13 on 20.12.2017. 10 | */ 11 | @Data 12 | public class VisitStatDTO implements Serializable { 13 | 14 | private Date dt; 15 | private Long post_id; 16 | private String title; 17 | private Long count; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/dto/VisitsStatsChartDTO.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import lombok.Data; 5 | import lombok.Getter; 6 | import lombok.RequiredArgsConstructor; 7 | import lombok.Setter; 8 | 9 | import java.io.Serializable; 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | /** 14 | * Created by bvn13 on 20.12.2017. 15 | */ 16 | @Data 17 | public class VisitsStatsChartDTO implements Serializable{ 18 | 19 | @Data 20 | @RequiredArgsConstructor 21 | public static class Type { 22 | private String type = ""; 23 | } 24 | 25 | @Data 26 | @RequiredArgsConstructor 27 | public static class Text { 28 | private String text = ""; 29 | } 30 | 31 | public static class XAxis { 32 | @Getter 33 | private List categories = new ArrayList<>(); 34 | } 35 | 36 | public static class YAxis { 37 | @Getter 38 | private Text title = new Text(); 39 | } 40 | 41 | public static class PlotOptions { 42 | @Getter 43 | private Line line = new Line(); 44 | } 45 | 46 | public static class Line { 47 | @Getter 48 | private DataLabels dataLabels = new DataLabels(); 49 | 50 | @Getter 51 | @Setter 52 | private Boolean enableMouseTracking = false; 53 | } 54 | 55 | @Data 56 | @RequiredArgsConstructor 57 | public static class DataLabels { 58 | private Boolean enabled = false; 59 | } 60 | 61 | @Data 62 | public static class Series { 63 | private String name; 64 | private List data = new ArrayList<>(); 65 | } 66 | 67 | private Type chart = new Type(); 68 | private Text title = new Text(); 69 | private Text subtitle = new Text(); 70 | @JsonProperty("xAxis") 71 | private XAxis xAxis = new XAxis(); 72 | @JsonProperty("yAxis") 73 | private YAxis yAxis = new YAxis(); 74 | private Line plotOptions = new Line(); 75 | 76 | private List series = new ArrayList<>(); 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/support/OgLocale.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models.support; 2 | 3 | public enum OgLocale { 4 | 5 | en_EN("en_EN"), 6 | ru_RU("ru_RU"); 7 | 8 | private String name; 9 | 10 | OgLocale(String name){ 11 | this.name = name; 12 | } 13 | 14 | public String getName() { 15 | return name; 16 | } 17 | 18 | public void setName(String name) { 19 | this.name = name; 20 | } 21 | 22 | public String getId(){ 23 | return name(); 24 | } 25 | 26 | @Override 27 | public String toString() { 28 | return getName(); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/support/OgType.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models.support; 2 | 3 | public enum OgType { 4 | 5 | ARTICLE("article"); 6 | 7 | private String name; 8 | 9 | OgType(String name){ 10 | this.name = name; 11 | } 12 | 13 | public String getName(){ 14 | return name; 15 | } 16 | 17 | public String getId() { 18 | return name(); 19 | } 20 | 21 | @Override 22 | public String toString() { 23 | return getName(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/support/PostFormat.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models.support; 2 | 3 | /** 4 | * @author Raysmond 5 | */ 6 | public enum PostFormat { 7 | HTML("Html"), 8 | MARKDOWN("Markdown"); 9 | 10 | private String name; 11 | 12 | PostFormat(String name){ 13 | this.name = name; 14 | } 15 | 16 | public String getName(){ 17 | return name; 18 | } 19 | 20 | public String getId() { 21 | return name(); 22 | } 23 | 24 | @Override 25 | public String toString() { 26 | return getName(); 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/support/PostStatus.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models.support; 2 | 3 | /** 4 | * @author Raysmond 5 | */ 6 | public enum PostStatus { 7 | DRAFT("Draft"), 8 | PUBLISHED("Published"); 9 | 10 | private String name; 11 | 12 | PostStatus(String name){ 13 | this.name = name; 14 | } 15 | 16 | public String getName() { 17 | return name; 18 | } 19 | 20 | public void setName(String name) { 21 | this.name = name; 22 | } 23 | 24 | public String getId(){ 25 | return name(); 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return getName(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/support/PostType.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models.support; 2 | 3 | /** 4 | * @author Raysmond 5 | */ 6 | public enum PostType { 7 | PAGE("Page"), 8 | POST("Post"); 9 | 10 | private String name; 11 | 12 | PostType(String name){ 13 | this.name = name; 14 | } 15 | 16 | public String getName() { 17 | return name; 18 | } 19 | 20 | public void setName(String name) { 21 | this.name = name; 22 | } 23 | 24 | public String getId(){ 25 | return name(); 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return getName(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/models/support/WebError.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.models.support; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.io.Serializable; 7 | 8 | @Getter 9 | @Setter 10 | public class WebError implements Serializable { 11 | 12 | private String field; 13 | 14 | private String errorMessage; 15 | 16 | public WebError(String field, String errorMessage) { 17 | this.field = field; 18 | this.errorMessage = errorMessage; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/notificators/Notificator.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.notificators; 2 | 3 | import com.raysmond.blog.models.Post; 4 | import com.raysmond.blog.notificators.telegram.TelegramBotManager; 5 | import com.raysmond.blog.services.AppSetting; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Component; 10 | import org.telegram.telegrambots.meta.exceptions.TelegramApiException; 11 | 12 | /** 13 | * Created by bvn13 on 21.12.2017. 14 | */ 15 | @Component 16 | public class Notificator { 17 | 18 | private static final Logger logger = LoggerFactory.getLogger(Notificator.class); 19 | 20 | @Autowired 21 | private AppSetting appSetting; 22 | 23 | @Autowired 24 | private TelegramBotManager telegramBot; 25 | 26 | 27 | public void announcePost(Post post) throws Exception { 28 | if (post == null || post.getAnnouncement().isEmpty()) { 29 | throw new IllegalArgumentException("Nothing to announce"); 30 | } 31 | String postUrl = appSetting.getMainUriStripped()+"/posts/"+(post.getPermalink().isEmpty() ? post.getId() : post.getPermalink()); 32 | String message = String.format( 33 | "*%s*\r\n\n" + 34 | "[%s](%s)\r\n\r\n"+ 35 | "%s\r\n\r\n" + 36 | "", 37 | post.getTitle(), 38 | postUrl, postUrl, 39 | post.getAnnouncement() != null ? post.getAnnouncement() : "" 40 | ); 41 | try { 42 | telegramBot.sendMessageToChannel(message); 43 | } catch (Exception e) { 44 | logger.error(String.format("Could not send message <%s>", message), e); 45 | throw e; 46 | } 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/repositories/LikeRepository.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.repositories; 2 | 3 | import com.raysmond.blog.models.Like; 4 | import com.raysmond.blog.models.Post; 5 | import com.raysmond.blog.models.User; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.Query; 8 | import org.springframework.data.repository.query.Param; 9 | import org.springframework.stereotype.Repository; 10 | 11 | @Repository 12 | public interface LikeRepository extends JpaRepository { 13 | 14 | @Query("SELECT SUM(l.sympathy) FROM Like AS l WHERE l.user = :user AND l.post = :post GROUP BY l.user, l.post") 15 | Integer getTotalLikesByUserAndPost(@Param("user") User user, @Param("post") Post post); 16 | 17 | @Query("SELECT SUM(l.sympathy) FROM Like AS l WHERE l.post = :post GROUP BY l.post") 18 | Integer getTotalLikesByPost(@Param("post") Post post); 19 | 20 | @Query("SELECT SUM(l.sympathy) FROM Like AS l WHERE l.clientIp = :clientIp AND l.post = :post GROUP BY l.clientIp, l.post") 21 | Integer getTotalLikesByClientIpAndPost(@Param("clientIp") String clientIp, @Param("post") Post post); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/repositories/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.repositories; 2 | 3 | import com.raysmond.blog.models.Post; 4 | import com.raysmond.blog.models.support.PostStatus; 5 | import com.raysmond.blog.models.support.PostType; 6 | import org.springframework.data.domain.Page; 7 | import org.springframework.data.domain.Pageable; 8 | import org.springframework.data.jpa.repository.JpaRepository; 9 | import org.springframework.data.jpa.repository.Query; 10 | import org.springframework.data.repository.query.Param; 11 | import org.springframework.stereotype.Repository; 12 | import org.springframework.transaction.annotation.Transactional; 13 | import java.util.Map; 14 | 15 | import java.util.List; 16 | 17 | /** 18 | * @author Raysmond 19 | */ 20 | @Repository 21 | @Transactional 22 | public interface PostRepository extends JpaRepository { 23 | Post findByPermalinkAndPostStatusAndDeleted(String permalink, PostStatus postStatus, Boolean deleted); 24 | 25 | Post findByIdAndPostStatusAndDeleted(Long postId, PostStatus postStatus, Boolean deleted); 26 | 27 | Page findAllByPostTypeAndDeleted(PostType postType, Pageable pageRequest, Boolean deleted); 28 | 29 | Page findAllByPostTypeAndPostStatusAndDeleted(PostType postType, PostStatus postStatus, Pageable pageRequest, Boolean deleted); 30 | 31 | List findAllByPostTypeAndPostStatusAndDeleted(PostType postType, PostStatus postStatus, Boolean deleted); 32 | 33 | Page findAllByDeleted(Pageable pageRequest, Boolean deleted); 34 | 35 | @Query("SELECT p FROM Post p INNER JOIN p.tags t WHERE t.name = :tag AND p.deleted = false") 36 | Page findByTag(@Param("tag") String tag, Pageable pageable); 37 | 38 | @Query("SELECT t.name, count(p) as tag_count from Post p " + 39 | "INNER JOIN p.tags t " + 40 | "WHERE p.postStatus = :status " + 41 | "AND p.deleted = false " + 42 | "GROUP BY t.id " + 43 | "ORDER BY tag_count DESC") 44 | List countPostsByTags(@Param("status") PostStatus status); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/repositories/SeoPostDataRepository.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.repositories; 2 | 3 | import com.raysmond.blog.models.SeoPostData; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface SeoPostDataRepository extends JpaRepository { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/repositories/SeoRobotAgentRepository.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.repositories; 2 | 3 | import com.raysmond.blog.models.SeoRobotAgent; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface SeoRobotAgentRepository extends JpaRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/repositories/SettingRepository.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.repositories; 2 | 3 | import com.raysmond.blog.models.Setting; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | /** 10 | * @author Raysmond 11 | */ 12 | @Repository 13 | @Transactional 14 | public interface SettingRepository extends JpaRepository { 15 | Setting findByKey(String key); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/repositories/StoredFileRepository.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.repositories; 2 | 3 | import com.raysmond.blog.models.StoredFile; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface StoredFileRepository extends JpaRepository { 7 | StoredFile findById(Long id); 8 | StoredFile findByName(String name); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/repositories/TagRepository.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.repositories; 2 | 3 | import com.raysmond.blog.models.Tag; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | /** 7 | * @author Raysmond. 8 | */ 9 | public interface TagRepository extends JpaRepository{ 10 | Tag findByName(String name); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/repositories/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.repositories; 2 | 3 | import com.raysmond.blog.models.User; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author Raysmond 13 | */ 14 | @Repository 15 | @Transactional 16 | public interface UserRepository extends JpaRepository { 17 | User findByEmail(String email); 18 | List findAllByRoleOrderById(String role); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/repositories/VisitRepository.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.repositories; 2 | 3 | import com.raysmond.blog.models.Post; 4 | import com.raysmond.blog.models.User; 5 | import com.raysmond.blog.models.Visit; 6 | import com.raysmond.blog.models.SeoRobotAgent; 7 | import org.springframework.data.jpa.repository.JpaRepository; 8 | import org.springframework.data.jpa.repository.Query; 9 | import org.springframework.data.repository.query.Param; 10 | 11 | import java.util.List; 12 | 13 | public interface VisitRepository extends JpaRepository { 14 | 15 | @Query( "SELECT COUNT(DISTINCT v.clientIp) " + 16 | "FROM Visit AS v " + 17 | //"LEFT JOIN v.robotsAgents AS ra " + 18 | //"ON v.userAgent LIKE concat('%', ra.userAgent, '%') "+ 19 | "WHERE v.post = :post AND v.isAdmin = FALSE " //+ 20 | //"AND ra.id IS NULL " 21 | ) 22 | Long getUniquePostVisitsCount(@Param("post") Post post); 23 | 24 | @Query( "SELECT v.clientIp, NULLIF(v.userAgent, '') " + 25 | "FROM Visit AS v " + 26 | "WHERE v.post = :post AND v.isAdmin = FALSE " + 27 | "GROUP BY v.clientIp, NULLIF(v.userAgent, '') " 28 | ) 29 | List getVisitsByPostAndIsAdminIsFalse(@Param("post") Post post); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/seo/controllers/SitemapController.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.seo.controllers; 2 | 3 | import com.raysmond.blog.models.Post; 4 | import com.raysmond.blog.services.PostService; 5 | import com.raysmond.blog.services.SeoService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.http.MediaType; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.ResponseBody; 12 | 13 | import java.util.List; 14 | 15 | @Controller 16 | @RequestMapping(value = {"/seo", ""}) 17 | public class SitemapController { 18 | 19 | @Autowired 20 | private PostService postService; 21 | 22 | @Autowired 23 | private SeoService seoService; 24 | 25 | @GetMapping(value = "/sitemap", produces = MediaType.APPLICATION_XML_VALUE) 26 | public @ResponseBody String getSiteMap() { 27 | List posts = this.postService.getAllPublishedPosts(); 28 | return this.seoService.createSitemap(posts); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/services/RequestProcessorService.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.services; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | @Service 8 | public class RequestProcessorService { 9 | 10 | public String getRealIp(HttpServletRequest request) { 11 | String xRealIp = request.getHeader("X-Real-IP"); 12 | if (xRealIp == null || request.getHeader("X-Real-IP").isEmpty()) { 13 | return request.getRemoteAddr(); 14 | } 15 | return xRealIp; 16 | } 17 | 18 | public String getUserAgent(HttpServletRequest request) { 19 | String userAgent = request.getHeader("User-Agent"); 20 | return userAgent; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/services/SeoRobotAgentService.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.services; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service 6 | public class SeoRobotAgentService { 7 | 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/services/SettingService.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.services; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * @author Raysmond 7 | */ 8 | public interface SettingService { 9 | Serializable get(String key); 10 | Serializable get(String key, Serializable defaultValue); 11 | void put(String key, Serializable value); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/services/TagService.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.services; 2 | 3 | import com.raysmond.blog.models.Tag; 4 | import com.raysmond.blog.repositories.TagRepository; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.cache.annotation.CacheEvict; 9 | import org.springframework.cache.annotation.Cacheable; 10 | import org.springframework.cache.annotation.Caching; 11 | import org.springframework.stereotype.Service; 12 | 13 | import java.util.List; 14 | 15 | 16 | /** 17 | * @author Raysmond. 18 | */ 19 | @Service 20 | public class TagService { 21 | private TagRepository tagRepository; 22 | 23 | private static final Logger logger = LoggerFactory.getLogger(PostService.class); 24 | 25 | public static final String CACHE_NAME = "cache.tag"; 26 | public static final String CACHE_NAME_TAGS = "cache.tag.all"; 27 | 28 | public static final String CACHE_TYPE = "'_Tag_'"; 29 | public static final String CACHE_KEY = CACHE_TYPE + " + #tagName"; 30 | public static final String CACHE_TAG_KEY = CACHE_TYPE + " + #tag.name"; 31 | 32 | @Autowired 33 | public TagService(TagRepository tagRepository){ 34 | this.tagRepository = tagRepository; 35 | } 36 | 37 | public Tag findOrCreateByName(String name){ 38 | Tag tag = tagRepository.findByName(name); 39 | if (tag == null){ 40 | tag = tagRepository.save(new Tag(name)); 41 | } 42 | return tag; 43 | } 44 | 45 | @Cacheable(value = CACHE_NAME, key = CACHE_KEY) 46 | public Tag getTag(String tagName) { 47 | return tagRepository.findByName(tagName); 48 | } 49 | 50 | @Caching(evict = { 51 | @CacheEvict(value = CACHE_NAME, key = CACHE_TAG_KEY), 52 | @CacheEvict(value = CACHE_NAME_TAGS, allEntries = true) 53 | }) 54 | public void deleteTag(Tag tag){ 55 | tagRepository.delete(tag); 56 | } 57 | 58 | @Cacheable(value = CACHE_NAME_TAGS, key = "#root.method.name") 59 | public List getAllTags(){ 60 | return tagRepository.findAll(); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/support/web/MarkdownService.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.support.web; 2 | 3 | /** 4 | * @author Raysmond 5 | */ 6 | public interface MarkdownService { 7 | public String renderToHtml(String content); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/support/web/Message.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.support.web; 2 | 3 | /** 4 | * A message to be displayed in web context. Depending on the type, different style will be applied. 5 | */ 6 | public class Message implements java.io.Serializable { 7 | /** 8 | * Name of the flash attribute. 9 | */ 10 | public static final String MESSAGE_ATTRIBUTE = "message"; 11 | 12 | /** 13 | * The type of the message to be displayed. The type is used to show message in a different style. 14 | */ 15 | public static enum Type { 16 | DANGER, WARNING, INFO, SUCCESS; 17 | } 18 | 19 | private final String message; 20 | private final Type type; 21 | private final Object[] args; 22 | 23 | public Message(String message, Type type) { 24 | this.message = message; 25 | this.type = type; 26 | this.args = null; 27 | } 28 | 29 | public Message(String message, Type type, Object... args) { 30 | this.message = message; 31 | this.type = type; 32 | this.args = args; 33 | } 34 | 35 | public String getMessage() { 36 | return message; 37 | } 38 | 39 | public Type getType() { 40 | return type; 41 | } 42 | 43 | public Object[] getArgs() { 44 | return args; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/support/web/SyntaxHighlightService.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.support.web; 2 | 3 | /** 4 | * @author Raysmond 5 | */ 6 | public interface SyntaxHighlightService { 7 | public String highlight(String content); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/utils/CommonHelper.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.utils; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collection; 5 | import java.util.List; 6 | 7 | /** 8 | * Created by bvn13 on 14.12.2017. 9 | */ 10 | public class CommonHelper { 11 | 12 | public static 13 | > List asSortedList(Collection c) { 14 | List list = new ArrayList(c); 15 | java.util.Collections.sort(list); 16 | return list; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/utils/DTOUtil.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.utils; 2 | 3 | import org.modelmapper.ModelMapper; 4 | import org.modelmapper.convention.MatchingStrategies; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | /** 10 | * @author Raysmond 11 | */ 12 | public class DTOUtil { 13 | 14 | private static ModelMapper MAPPER = null; 15 | 16 | private static ModelMapper getMapper(){ 17 | if(MAPPER == null){ 18 | MAPPER = new ModelMapper(); 19 | MAPPER.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT); 20 | } 21 | 22 | return MAPPER; 23 | } 24 | 25 | public static T map(S source, Class targetClass) { 26 | return getMapper().map(source, targetClass); 27 | } 28 | 29 | public static void mapTo(S source, T dist) { 30 | getMapper().map(source, dist); 31 | } 32 | 33 | public static List mapList(List source, Class targetClass) { 34 | List list = new ArrayList<>(); 35 | for (S s : source) { 36 | list.add(getMapper().map(s, targetClass)); 37 | } 38 | return list; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/raysmond/blog/utils/PaginatorUtil.java: -------------------------------------------------------------------------------- 1 | package com.raysmond.blog.utils; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * Created by bvn13 on 11.12.2017. 8 | */ 9 | public class PaginatorUtil { 10 | 11 | public static List createPagesList(Integer from, Integer to, Integer pageSize) { 12 | List result = new ArrayList<>(); 13 | Integer lastPage = (int) Math.ceil(to / pageSize); 14 | for (int i=from; i<=lastPage; i++) { 15 | result.add(i); 16 | } 17 | return result; 18 | } 19 | 20 | public static List createPagesList(Integer from, Integer to) { 21 | List result = new ArrayList<>(); 22 | for (int i=from; i<=to; i++) { 23 | result.add(i); 24 | } 25 | return result; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/resources/application-mysql.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9000 3 | contextPath: 4 | 5 | spring: 6 | profiles: 7 | active: dev 8 | 9 | thymeleaf: 10 | cache: false 11 | 12 | jade4j: 13 | caching: false 14 | 15 | dataSource: 16 | driverClassName: com.mysql.cj.jdbc.Driver 17 | url: jdbc:mysql://mysql/spring_blog?serverTimezone=UTC 18 | username: root 19 | password: 123456 20 | 21 | hibernate: 22 | dialect: org.hibernate.dialect.MySQLDialect 23 | hbm2ddl.auto: update 24 | show_sql: false 25 | 26 | redis: 27 | host: localhost 28 | port: 6379 29 | default_expire_time: 86400 30 | 31 | -------------------------------------------------------------------------------- /src/main/resources/application-production.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8001 3 | contextPath: 4 | servlet: 5 | sesssion: 6 | timeout: 86400 7 | 8 | app: 9 | ads: 10 | adsence: 11 | head: private/adsence_head.code 12 | top: private/adsence_top.code 13 | bottom: private/adsence_bottom.code 14 | yandex: 15 | main_page: private/yandex_main_page.code 16 | top: private/yandex_top.code 17 | bottom: private/yandex_bottom.code 18 | 19 | telegram: 20 | bot: 21 | enabled: true 22 | name: bvn13_blog_bot 23 | channel: bvn13_blog 24 | token_file: private/telegram_bot.token 25 | master_name : bvn13 26 | proxy: 27 | host: 28 | port: 29 | username: 30 | password: 31 | type: 32 | 33 | 34 | spring: 35 | profiles: 36 | active: production 37 | 38 | thymeleaf: 39 | cache: false 40 | 41 | jade4j: 42 | caching: false 43 | 44 | dataSource: 45 | driverClassName: org.postgresql.Driver 46 | url: jdbc:postgresql://localhost:5432/blog 47 | username: blog 48 | password: blogpass 49 | 50 | hibernate: 51 | dialect: org.hibernate.dialect.PostgreSQLDialect 52 | hbm2ddl.auto: update 53 | show_sql: true 54 | use_sql_comments: true 55 | format_sql: true 56 | 57 | redis: 58 | host: localhost 59 | port: 6379 60 | default_expire_time: 86400 61 | 62 | 63 | session: 64 | store-type: redis 65 | 66 | http: 67 | multipart: 68 | max-file-size: 100Mb 69 | max-request-size: 100Mb 70 | 71 | -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8001 3 | contextPath: 4 | servlet: 5 | sesssion: 6 | timeout: 86400 7 | 8 | 9 | app: 10 | ads: 11 | adsence: 12 | head: private/adsence_head.code 13 | top: private/adsence_top.code 14 | bottom: private/adsence_bottom.code 15 | yandex: 16 | main_page: private/yandex_main_page.code 17 | top: private/yandex_top.code 18 | bottom: private/yandex_bottom.code 19 | 20 | telegram: 21 | bot: 22 | enabled: true 23 | name: bvn13_blog_test_bot 24 | channel: bvn13_blog_test 25 | token_file: private/telegram_bot_test.token 26 | master_name : bvn13 27 | proxy: 28 | host: 29 | port: 30 | username: 31 | password: 32 | type: 33 | 34 | 35 | spring: 36 | profiles: 37 | active: dev 38 | 39 | thymeleaf: 40 | cache: false 41 | 42 | jade4j: 43 | caching: false 44 | 45 | dataSource: 46 | driverClassName: org.postgresql.Driver 47 | url: jdbc:postgresql://localhost:5432/blog 48 | username: blog 49 | password: blogpass 50 | 51 | hibernate: 52 | dialect: org.hibernate.dialect.PostgreSQLDialect 53 | hbm2ddl.auto: update 54 | show_sql: true 55 | use_sql_comments: true 56 | format_sql: true 57 | 58 | redis: 59 | host: localhost 60 | port: 6379 61 | default_expire_time: 86400 62 | 63 | 64 | session: 65 | store-type: redis 66 | 67 | http: 68 | multipart: 69 | max-file-size: 100Mb 70 | max-request-size: 100Mb 71 | 72 | -------------------------------------------------------------------------------- /src/main/resources/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | view.index.title=Home page 2 | signup.success=Congratulations {0}! You have successfully signed up. 3 | signin.already=You have already signed in. 4 | 5 | # Validation messages 6 | notBlank.message = The value may not be empty! 7 | email.message = The value must be a valid email! -------------------------------------------------------------------------------- /src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | SpringBlog 4 | 5 | 6 | 7 | 8 | %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{32} - %msg%n 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/main/resources/queries/visits.sql: -------------------------------------------------------------------------------- 1 | 2 | select date_trunc('day', v.createdat) as dt, v.post_id, p.title, count(distinct v.clientip) as count 3 | from visits as v 4 | left join seo_robots_agents as ra 5 | on case when ra.isregexp then lower(nullif(v.useragent,'')) ~* lower(ra.useragent) 6 | else lower(nullif(v.useragent,'')) like concat('%',lower(ra.useragent),'%') end 7 | inner join posts as p 8 | on v.post_id = p.id 9 | where v.isadmin = false 10 | and ra.id isnull 11 | group by date_trunc('day', v.createdat), v.post_id, p.title 12 | order by date_trunc('day', v.createdat), v.post_id -------------------------------------------------------------------------------- /src/main/resources/resources/css/admin/admin.css: -------------------------------------------------------------------------------- 1 | body { 2 | -webkit-font-smoothing: antialiased; 3 | color: #434343; 4 | } 5 | 6 | .main-container{ 7 | padding-top: 60px; 8 | } 9 | 10 | form .item-row{ 11 | margin-top: 10px; 12 | } 13 | 14 | td.operations, th.operations{ 15 | text-align: center; 16 | width: 120px; 17 | } 18 | td.operations a{ 19 | margin-left: 5px; 20 | margin-bottom: 5px; 21 | } 22 | 23 | .post-form textarea{ 24 | height: 350px; 25 | } 26 | 27 | 28 | .post-form #content-editor{ 29 | height: 430px; 30 | width: 100%; 31 | } 32 | 33 | 34 | .settings-form tbody td.setting-label{ 35 | width: 250px; 36 | text-align: right; 37 | padding-right: 20px; 38 | vertical-align: middle; 39 | font-weight: bold; 40 | } 41 | 42 | .profile .row .col-sm-2{ 43 | font-weight: bold; 44 | text-align: right; 45 | padding-right: 30px; 46 | } 47 | 48 | .mt-5 { margin-top:5px; } 49 | .mt-7 { margin-top:7px; } 50 | .mt-10 { margin-top:10px; } 51 | .mt-15 { margin-top:15px; } 52 | .mt-17 { margin-top:17px; } 53 | .mt-30 { margin-top:30px; } 54 | 55 | 56 | .loading { 57 | display: block; /*for the img inside your div */ 58 | margin-left: auto; 59 | margin-right: auto; 60 | } 61 | 62 | .loading-error { 63 | display: block; /*for the img inside your div */ 64 | margin-left: auto; 65 | margin-right: auto; 66 | } -------------------------------------------------------------------------------- /src/main/resources/resources/images/dislike.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bvn13/SpringBlog/d3f35ea86c6859e583b86ee00259d8650c1a99e8/src/main/resources/resources/images/dislike.png -------------------------------------------------------------------------------- /src/main/resources/resources/images/dislike_min.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bvn13/SpringBlog/d3f35ea86c6859e583b86ee00259d8650c1a99e8/src/main/resources/resources/images/dislike_min.png -------------------------------------------------------------------------------- /src/main/resources/resources/images/icon_error.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/main/resources/resources/images/like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bvn13/SpringBlog/d3f35ea86c6859e583b86ee00259d8650c1a99e8/src/main/resources/resources/images/like.png -------------------------------------------------------------------------------- /src/main/resources/resources/images/like_min.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bvn13/SpringBlog/d3f35ea86c6859e583b86ee00259d8650c1a99e8/src/main/resources/resources/images/like_min.png -------------------------------------------------------------------------------- /src/main/resources/resources/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bvn13/SpringBlog/d3f35ea86c6859e583b86ee00259d8650c1a99e8/src/main/resources/resources/images/loading.gif -------------------------------------------------------------------------------- /src/main/resources/resources/images/open-eye-with-blank-pupil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bvn13/SpringBlog/d3f35ea86c6859e583b86ee00259d8650c1a99e8/src/main/resources/resources/images/open-eye-with-blank-pupil.png -------------------------------------------------------------------------------- /src/main/resources/resources/images/open-eye-with-blank-pupil_min.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bvn13/SpringBlog/d3f35ea86c6859e583b86ee00259d8650c1a99e8/src/main/resources/resources/images/open-eye-with-blank-pupil_min.png -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/bootstrap-paginator-1.0.2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2013 Yun Lai 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/bootstrap-paginator-1.0.2/README.md: -------------------------------------------------------------------------------- 1 | # Bootstrap Paginator v1.0 2 | 3 | --- 4 | 5 | Bootstrap Paginator is a jQuery plugin that simplifies the rendering of Bootstrap Pagination component. It provides methods to automates the update of the pagination status and also some events to notify the status changes within the component. For documentation and examples, please visit [Bootstrap Paginator Website](http://bootstrappaginator.org/ "Click to visit Bootstrap Paginator"). 6 | 7 | # Changes 8 | 9 | v 1.0 10 | 11 | * Add the support for bootstrap v3. 12 | * Make the page change happened in page click event stoppable 13 | * Remove the visibility control within getPages function and leave it with shouldShowPage function. 14 | 15 | v 0.6 16 | 17 | * Fix the bug that will cause page out of range when updating the current page together with the total pages. 18 | 19 | v 0.5.1 20 | 21 | * Use html entities in default text function instead of plain text to fix the display problem in IE 7-9 22 | 23 | # Copyright and License 24 | Copyright 2013 Yun Lai 25 | 26 | Licensed under the Apache License, Version 2.0 (the "License"); 27 | you may not use this file except in compliance with the License. 28 | You may obtain a copy of the License at 29 | 30 | 31 | 32 | Unless required by applicable law or agreed to in writing, software 33 | distributed under the License is distributed on an "AS IS" BASIS, 34 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 35 | See the License for the specific language governing permissions and 36 | limitations under the License. -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/.npmignore: -------------------------------------------------------------------------------- 1 | .git* 2 | test/ 3 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | - "0.8" 5 | - "0.6" 6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/Gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var uglify = require('gulp-uglify'); 3 | var concat = require('gulp-concat'); 4 | 5 | var preserveFirstComment = function() { 6 | var set = false; 7 | 8 | return function() { 9 | if (set) return false; 10 | set = true; 11 | return true; 12 | }; 13 | }; 14 | 15 | gulp.task('uglify', function() { 16 | gulp.src('lib/marked.js') 17 | .pipe(uglify({preserveComments: preserveFirstComment()})) 18 | .pipe(concat('marked.min.js')) 19 | .pipe(gulp.dest('.')); 20 | }); 21 | 22 | gulp.task('default', ['uglify']); 23 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | @cp lib/marked.js marked.js 3 | @uglifyjs --comments '/\*[^\0]+?Copyright[^\0]+?\*/' -o marked.min.js lib/marked.js 4 | 5 | clean: 6 | @rm marked.js 7 | @rm marked.min.js 8 | 9 | bench: 10 | @node test --bench 11 | 12 | .PHONY: clean all 13 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "marked", 3 | "version": "0.3.4", 4 | "homepage": "https://github.com/chjj/marked", 5 | "authors": [ 6 | "Christopher Jeffrey " 7 | ], 8 | "description": "A markdown parser built for speed", 9 | "keywords": [ 10 | "markdown", 11 | "markup", 12 | "html" 13 | ], 14 | "main": "lib/marked.js", 15 | "license": "MIT", 16 | "ignore": [ 17 | "**/.*", 18 | "node_modules", 19 | "bower_components", 20 | "app/bower_components", 21 | "test", 22 | "tests" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "marked", 3 | "version": "0.3.4", 4 | "repo": "chjj/marked", 5 | "description": "A markdown parser built for speed", 6 | "keywords": ["markdown", "markup", "html"], 7 | "scripts": ["lib/marked.js"], 8 | "main": "lib/marked.js", 9 | "license": "MIT" 10 | } 11 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/doc/todo.md: -------------------------------------------------------------------------------- 1 | # Todo 2 | 3 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/marked'); 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "marked", 3 | "description": "A markdown parser built for speed", 4 | "author": "Christopher Jeffrey", 5 | "version": "0.3.6", 6 | "main": "./lib/marked.js", 7 | "bin": "./bin/marked", 8 | "man": "./man/marked.1", 9 | "preferGlobal": true, 10 | "repository": "git://github.com/chjj/marked.git", 11 | "homepage": "https://github.com/chjj/marked", 12 | "bugs": { "url": "http://github.com/chjj/marked/issues" }, 13 | "license": "MIT", 14 | "keywords": ["markdown", "markup", "html"], 15 | "tags": ["markdown", "markup", "html"], 16 | "devDependencies": { 17 | "markdown": "*", 18 | "showdown": "*", 19 | "gulp": "^3.8.11", 20 | "gulp-uglify": "^1.1.0", 21 | "gulp-concat": "^2.5.2" 22 | }, 23 | "scripts": { "test": "node test", "bench": "node test --bench" } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/README: -------------------------------------------------------------------------------- 1 | In this directory: 2 | 3 | # 4 | # MarkdownTester -- Run tests for Markdown implementations 5 | # 6 | # Copyright (c) 2004-2005 John Gruber 7 | # 8 | # 9 | 10 | Partially modified for testing purposes. 11 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/browser/index.html: -------------------------------------------------------------------------------- 1 | 2 | marked tests 3 |

testing...

4 | 5 | 6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/browser/index.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | 3 | var test = require('../') 4 | , runTests = test.runTests 5 | , load = test.load; 6 | 7 | var express = require('express') 8 | , app = express(); 9 | 10 | app.use(function(req, res, next) { 11 | var setHeader = res.setHeader; 12 | res.setHeader = function(name) { 13 | switch (name) { 14 | case 'Cache-Control': 15 | case 'Last-Modified': 16 | case 'ETag': 17 | return; 18 | } 19 | return setHeader.apply(res, arguments); 20 | }; 21 | next(); 22 | }); 23 | 24 | var dir = __dirname + '/../tests' 25 | , files = {}; 26 | 27 | app.get('/test.js', function(req, res, next) { 28 | var test = fs.readFileSync(__dirname + '/test.js', 'utf8') 29 | , files = load(); 30 | 31 | test = test.replace('__TESTS__', JSON.stringify(files)); 32 | test = test.replace('__MAIN__', runTests + ''); 33 | 34 | res.contentType('.js'); 35 | res.send(test); 36 | }); 37 | 38 | app.use(express.static(__dirname + '/../../lib')); 39 | app.use(express.static(__dirname)); 40 | 41 | app.listen(8080); 42 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/browser/test.js: -------------------------------------------------------------------------------- 1 | ;(function() { 2 | 3 | var console = {} 4 | , files = __TESTS__; 5 | 6 | console.log = function(text) { 7 | var args = Array.prototype.slice.call(arguments, 1) 8 | , i = 0; 9 | 10 | text = text.replace(/%\w/g, function() { 11 | return args[i++] || ''; 12 | }); 13 | 14 | if (window.console) window.console.log(text); 15 | document.body.innerHTML += '
' + escape(text) + '
'; 16 | }; 17 | 18 | if (!Object.keys) { 19 | Object.keys = function(obj) { 20 | var out = [] 21 | , key; 22 | 23 | for (key in obj) { 24 | if (Object.prototype.hasOwnProperty.call(obj, key)) { 25 | out.push(key); 26 | } 27 | } 28 | 29 | return out; 30 | }; 31 | } 32 | 33 | if (!Array.prototype.forEach) { 34 | Array.prototype.forEach = function(callback, context) { 35 | for (var i = 0; i < this.length; i++) { 36 | callback.call(context || null, this[i], i, obj); 37 | } 38 | }; 39 | } 40 | 41 | if (!String.prototype.trim) { 42 | String.prototype.trim = function() { 43 | return this.replace(/^\s+|\s+$/g, ''); 44 | }; 45 | } 46 | 47 | function load() { 48 | return files; 49 | } 50 | 51 | function escape(html, encode) { 52 | return html 53 | .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') 54 | .replace(//g, '>') 56 | .replace(/"/g, '"') 57 | .replace(/'/g, '''); 58 | } 59 | 60 | (__MAIN__)(); 61 | 62 | }).call(this); 63 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/autolink_lines.html: -------------------------------------------------------------------------------- 1 |

hello world 2 | http://example.com 3 |

4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/autolink_lines.text: -------------------------------------------------------------------------------- 1 | hello world 2 | 3 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/blockquote_list_item.html: -------------------------------------------------------------------------------- 1 |

This fails in markdown.pl and upskirt:

2 | 3 |
  • hello

    world

4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/blockquote_list_item.text: -------------------------------------------------------------------------------- 1 | This fails in markdown.pl and upskirt: 2 | 3 | * hello 4 | > world 5 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/case_insensitive_refs.html: -------------------------------------------------------------------------------- 1 |

hi

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/case_insensitive_refs.text: -------------------------------------------------------------------------------- 1 | [hi] 2 | 3 | [HI]: /url 4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/def_blocks.html: -------------------------------------------------------------------------------- 1 |
2 |

hello 3 | [1]: hello

4 |
5 | 6 |
7 | 8 |
9 |

hello

10 |
11 | 12 | 13 |
    14 |
  • hello
  • 15 |
  • [3]: hello
  • 16 |
17 | 18 | 19 |
    20 |
  • hello
  • 21 |
22 | 23 | 24 |
25 |

foo 26 | bar 27 | bar

28 |
29 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/def_blocks.text: -------------------------------------------------------------------------------- 1 | > hello 2 | > [1]: hello 3 | 4 | * * * 5 | 6 | > hello 7 | [2]: hello 8 | 9 | 10 | * hello 11 | * [3]: hello 12 | 13 | 14 | * hello 15 | [4]: hello 16 | 17 | 18 | > foo 19 | > bar 20 | [1]: foo 21 | > bar 22 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/double_link.html: -------------------------------------------------------------------------------- 1 |

Already linked: http://example.com/.

2 | 3 |

Already linked: http://example.com/.

4 | 5 |

Already linked: http://example.com/.

6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/double_link.text: -------------------------------------------------------------------------------- 1 |

Already linked: http://example.com/.

2 | 3 | Already linked: [http://example.com/](http://example.com/). 4 | 5 | Already linked: **http://example.com/**. 6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/escaped_angles.html: -------------------------------------------------------------------------------- 1 |

>

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/escaped_angles.text: -------------------------------------------------------------------------------- 1 | \> 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_break.breaks.html: -------------------------------------------------------------------------------- 1 |

Look at the
pretty line
breaks.

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_break.breaks.text: -------------------------------------------------------------------------------- 1 | Look at the 2 | pretty line 3 | breaks. 4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_code.html: -------------------------------------------------------------------------------- 1 |
var a = 'hello';
 2 | console.log(a + ' world');
3 |
echo "hello, ${WORLD}"
4 |
Q: What do you call a tall person who sells stolen goods?
5 |
A longfence!
6 |

How about an empty code block?

7 |
8 |

How about a code block with only an empty line?

9 |

10 | 
11 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_code.text: -------------------------------------------------------------------------------- 1 | ``` js 2 | var a = 'hello'; 3 | console.log(a + ' world'); 4 | ``` 5 | 6 | ~~~bash 7 | echo "hello, ${WORLD}" 8 | ~~~ 9 | 10 | ```````longfence 11 | Q: What do you call a tall person who sells stolen goods? 12 | ``````` 13 | 14 | ~~~~~~~~~~ ManyTildes 15 | A longfence! 16 | ~~~~~~~~~~ 17 | 18 | How about an empty code block? 19 | 20 | ```js 21 | ``` 22 | 23 | How about a code block with only an empty line? 24 | 25 | ```js 26 | 27 | ``` 28 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_code_hr_list.html: -------------------------------------------------------------------------------- 1 |

foo

2 |
    3 |
  1. bar:

    4 |
    5 |
      6 |
    • one
        7 |
      • two
          8 |
        • three
        • 9 |
        • four
        • 10 |
        • five
        • 11 |
        12 |
      • 13 |
      14 |
    • 15 |
    16 |
    17 |
  2. 18 |
  3. foo:

    19 |
     line 1
    20 |  line 2
    21 |
  4. 22 |
  5. foo:

    23 |
      24 |
    1. foo bar bar:

      25 |
       some code here
      26 | 
      27 |
    2. 28 |
    3. foo bar bar:

      29 |
       foo
      30 |  ---
      31 |  bar
      32 |  ---
      33 |  foo
      34 |  bar
      35 |
    4. 36 |
    5. foo bar bar:

      37 |
       ---
      38 |  foo
      39 |  foo
      40 |  ---
      41 |  bar
      42 |
    6. 43 |
    7. foo bar bar:

      44 |
       foo
      45 |  ---
      46 |  bar
      47 |
    8. 48 |
    9. foo

      49 |
    10. 50 |
    51 |
  6. 52 |
53 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_code_hr_list.text: -------------------------------------------------------------------------------- 1 | ## foo 2 | 3 | 1. bar: 4 | 5 | > - one 6 | - two 7 | - three 8 | - four 9 | - five 10 | 11 | 1. foo: 12 | 13 | ``` 14 | line 1 15 | line 2 16 | ``` 17 | 18 | 1. foo: 19 | 20 | 1. foo `bar` bar: 21 | 22 | ``` erb 23 | some code here 24 | ``` 25 | 26 | 2. foo `bar` bar: 27 | 28 | ``` erb 29 | foo 30 | --- 31 | bar 32 | --- 33 | foo 34 | bar 35 | ``` 36 | 37 | 3. foo `bar` bar: 38 | 39 | ``` html 40 | --- 41 | foo 42 | foo 43 | --- 44 | bar 45 | ``` 46 | 47 | 4. foo `bar` bar: 48 | 49 | foo 50 | --- 51 | bar 52 | 53 | 5. foo 54 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_del.html: -------------------------------------------------------------------------------- 1 |

hello hi world

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_del.text: -------------------------------------------------------------------------------- 1 | hello ~~hi~~ world 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_em.html: -------------------------------------------------------------------------------- 1 |

These words should_not_be_emphasized.

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_em.text: -------------------------------------------------------------------------------- 1 | These words should_not_be_emphasized. 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_hashtag.gfm.html: -------------------------------------------------------------------------------- 1 |

#header

2 | 3 |

header1

4 | 5 |

header2

6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_hashtag.gfm.text: -------------------------------------------------------------------------------- 1 | #header 2 | 3 | # header1 4 | 5 | # header2 6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_hashtag.nogfm.html: -------------------------------------------------------------------------------- 1 |

header

2 | 3 |

header1

4 | 5 |

header2

6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_hashtag.nogfm.text: -------------------------------------------------------------------------------- 1 | #header 2 | 3 | # header1 4 | 5 | # header2 6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_links.html: -------------------------------------------------------------------------------- 1 |

This should be a link: 2 | http://example.com/hello-world.

3 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_links.text: -------------------------------------------------------------------------------- 1 | This should be a link: http://example.com/hello-world. 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_tables.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
Heading 1Heading 2
Cell 1Cell 2
Cell 3Cell 4
10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
Header 1Header 2Header 3Header 4
Cell 1Cell 2Cell 3Cell 4
Cell 5Cell 6Cell 7Cell 8
19 |
Test code
20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Header 1Header 2
Cell 1Cell 2
Cell 3Cell 4
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
Header 1Header 2Header 3Header 4
Cell 1Cell 2Cell 3Cell 4
Cell 5Cell 6Cell 7Cell 8
38 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/gfm_tables.text: -------------------------------------------------------------------------------- 1 | | Heading 1 | Heading 2 2 | | --------- | --------- 3 | | Cell 1 | Cell 2 4 | | Cell 3 | Cell 4 5 | 6 | | Header 1 | Header 2 | Header 3 | Header 4 | 7 | | :------: | -------: | :------- | -------- | 8 | | Cell 1 | Cell 2 | Cell 3 | Cell 4 | 9 | | Cell 5 | Cell 6 | Cell 7 | Cell 8 | 10 | 11 | Test code 12 | 13 | Header 1 | Header 2 14 | -------- | -------- 15 | Cell 1 | Cell 2 16 | Cell 3 | Cell 4 17 | 18 | Header 1|Header 2|Header 3|Header 4 19 | :-------|:------:|-------:|-------- 20 | Cell 1 |Cell 2 |Cell 3 |Cell 4 21 | *Cell 5*|Cell 6 |Cell 7 |Cell 8 22 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/hr_list_break.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • hello 3 | world
  • 4 |
  • how 5 | are
  • 6 |
7 | 8 |
9 | 10 |

you today?

11 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/hr_list_break.text: -------------------------------------------------------------------------------- 1 | * hello 2 | world 3 | * how 4 | are 5 | * * * 6 | you today? 7 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/lazy_blockquotes.html: -------------------------------------------------------------------------------- 1 |
2 |

hi there 3 | bud

4 |
5 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/lazy_blockquotes.text: -------------------------------------------------------------------------------- 1 | > hi there 2 | bud 3 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/list_item_text.html: -------------------------------------------------------------------------------- 1 |
  • item1

    • item2

    text

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/list_item_text.text: -------------------------------------------------------------------------------- 1 | * item1 2 | 3 | * item2 4 | 5 | text 6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/loose_lists.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • hello 3 | world

    4 | 5 |

    how 6 | are

  • 7 |
  • you
  • 8 |
9 | 10 | 11 | 12 |

better behavior:

13 | 14 |
  • hello

    • world 15 | how

      are 16 | you

    • today

  • hi
17 | 18 | 19 | 20 |
    21 |
  • hello

  • 22 |
  • world

  • 23 |
  • hi
  • 24 |
25 | 26 | 27 | 28 |
    29 |
  • hello
  • 30 |
  • world

  • 31 |
  • hi

  • 32 |
33 | 34 | 35 | 36 |
    37 |
  • hello
  • 38 |
  • world

    39 | 40 |

    how

  • 41 |
  • hi
  • 42 |
43 | 44 | 45 | 46 |
    47 |
  • hello
  • 48 |
  • world
  • 49 |
  • how

    50 | 51 |

    are

  • 52 |
53 | 54 | 55 | 56 |
    57 |
  • hello
  • 58 |
  • world

  • 59 |
  • how

    60 | 61 |

    are

  • 62 |
63 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/loose_lists.text: -------------------------------------------------------------------------------- 1 | * hello 2 | world 3 | 4 | how 5 | are 6 | * you 7 | 8 | 9 | 10 | better behavior: 11 | 12 | * hello 13 | * world 14 | how 15 | 16 | are 17 | you 18 | 19 | * today 20 | * hi 21 | 22 | 23 | 24 | * hello 25 | 26 | * world 27 | * hi 28 | 29 | 30 | 31 | * hello 32 | * world 33 | 34 | * hi 35 | 36 | 37 | 38 | * hello 39 | * world 40 | 41 | how 42 | * hi 43 | 44 | 45 | 46 | * hello 47 | * world 48 | * how 49 | 50 | are 51 | 52 | 53 | 54 | * hello 55 | * world 56 | 57 | * how 58 | 59 | are 60 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/main.html: -------------------------------------------------------------------------------- 1 |

A heading

Just a note, I've found that I can't test my markdown parser vs others. For example, both markdown.js and showdown code blocks in lists wrong. They're also completely inconsistent with regards to paragraphs in list items.

A link. Not anymore.

  • List Item 1

  • List Item 2

    • New List Item 1 Hi, this is a list item.
    • New List Item 2 Another item
      Code goes here.
      3 | Lots of it...
    • New List Item 3 The last item
  • List Item 3 The final item.

  • List Item 4 The real final item.

Paragraph.

  • bq Item 1
  • bq Item 2
    • New bq Item 1
    • New bq Item 2 Text here

Another blockquote! I really need to get more creative with mockup text.. markdown.js breaks here again

Another Heading

Hello world. Here is a link. And an image alt.

Code goes here.
4 | Lots of it...
5 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/main.text: -------------------------------------------------------------------------------- 1 | [test]: http://google.com/ "Google" 2 | 3 | # A heading 4 | 5 | Just a note, I've found that I can't test my markdown parser vs others. 6 | For example, both markdown.js and showdown code blocks in lists wrong. They're 7 | also completely [inconsistent][test] with regards to paragraphs in list items. 8 | 9 | A link. Not anymore. 10 | 11 | 13 | 14 | * List Item 1 15 | 16 | * List Item 2 17 | * New List Item 1 18 | Hi, this is a list item. 19 | * New List Item 2 20 | Another item 21 | Code goes here. 22 | Lots of it... 23 | * New List Item 3 24 | The last item 25 | 26 | * List Item 3 27 | The final item. 28 | 29 | * List Item 4 30 | The real final item. 31 | 32 | Paragraph. 33 | 34 | > * bq Item 1 35 | > * bq Item 2 36 | > * New bq Item 1 37 | > * New bq Item 2 38 | > Text here 39 | 40 | * * * 41 | 42 | > Another blockquote! 43 | > I really need to get 44 | > more creative with 45 | > mockup text.. 46 | > markdown.js breaks here again 47 | 48 | Another Heading 49 | ------------- 50 | 51 | Hello *world*. Here is a [link](//hello). 52 | And an image ![alt](src). 53 | 54 | Code goes here. 55 | Lots of it... 56 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/nested_code.html: -------------------------------------------------------------------------------- 1 |

hi ther `` ok ```

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/nested_code.text: -------------------------------------------------------------------------------- 1 | ````` hi ther `` ok ``` ````` 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/nested_em.html: -------------------------------------------------------------------------------- 1 |

test test test

2 | 3 |

test test test

4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/nested_em.text: -------------------------------------------------------------------------------- 1 | *test **test** test* 2 | 3 | _test __test__ test_ 4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/nested_square_link.html: -------------------------------------------------------------------------------- 1 |

the ] character

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/nested_square_link.text: -------------------------------------------------------------------------------- 1 | [the `]` character](/url) 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/not_a_link.html: -------------------------------------------------------------------------------- 1 |

[test](not a link)

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/not_a_link.text: -------------------------------------------------------------------------------- 1 | \[test](not a link) 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/ref_paren.html: -------------------------------------------------------------------------------- 1 |

hi

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/ref_paren.text: -------------------------------------------------------------------------------- 1 | [hi] 2 | 3 | [hi]: /url (there) 4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/same_bullet.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • test
  • 3 |
  • test
  • 4 |
  • test
  • 5 |
6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/same_bullet.text: -------------------------------------------------------------------------------- 1 | * test 2 | + test 3 | - test 4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/text.smartypants.html: -------------------------------------------------------------------------------- 1 |

Hello world ‘how’ “are” you — today…

2 | 3 |

“It’s a more ‘challenging’ smartypants test…”

4 | 5 |

‘And,’ as a bonus — “one 6 | multiline” test!

7 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/text.smartypants.text: -------------------------------------------------------------------------------- 1 | Hello world 'how' "are" you -- today... 2 | 3 | "It's a more 'challenging' smartypants test..." 4 | 5 | 'And,' as a bonus -- "one 6 | multiline" test! 7 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/toplevel_paragraphs.gfm.html: -------------------------------------------------------------------------------- 1 |

hello world 2 | how are you 3 | how are you

4 | 5 |

hello world

6 |
how are you
7 | 8 |

hello world

9 |
10 | 11 |

hello world

12 |

how are you

13 | 14 |

hello world

15 |

how are you

16 | 17 |

hello world

18 |

how are you

19 | 20 |

hello world

21 |
  • how are you
22 | 23 |

hello world

24 |
how are you
25 | 26 |

hello world 27 | how are you

28 | 29 |

hello world 30 |

31 | 32 |
hello
33 | 34 |

hello

35 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/toplevel_paragraphs.gfm.text: -------------------------------------------------------------------------------- 1 | hello world 2 | how are you 3 | how are you 4 | 5 | hello world 6 | ``` 7 | how are you 8 | ``` 9 | 10 | hello world 11 | * * * 12 | 13 | hello world 14 | # how are you 15 | 16 | hello world 17 | how are you 18 | =========== 19 | 20 | hello world 21 | > how are you 22 | 23 | hello world 24 | * how are you 25 | 26 | hello world 27 |
how are you
28 | 29 | hello world 30 | how are you 31 | 32 | hello [world][how] 33 | [how]: /are/you 34 | 35 |
hello
36 | 37 | hello 38 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/tricky_list.html: -------------------------------------------------------------------------------- 1 |

hello world

2 | 3 |
    4 |
  • hello world
  • 5 |
6 | 7 |

hello world

8 | 9 |
    10 |
  • hello world
  • 11 |
12 | 13 |

hello world

14 | 15 |
    16 |
  • Hello world
  • 17 |
18 | 19 |

hello world

20 | 21 |
    22 |
  • hello world
  • 23 |
24 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/new/tricky_list.text: -------------------------------------------------------------------------------- 1 | **hello** _world_ 2 | 3 | * hello world 4 | 5 | **hello** _world_ 6 | 7 | * hello world 8 | 9 | **hello** _world_ 10 | 11 | * Hello world 12 | 13 | **hello** _world_ 14 | 15 | * hello world 16 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/amps_and_angles_encoding.html: -------------------------------------------------------------------------------- 1 |

AT&T has an ampersand in their name.

2 | 3 |

AT&T is another way to write it.

4 | 5 |

This & that.

6 | 7 |

4 < 5.

8 | 9 |

6 > 5.

10 | 11 |

Here's a link with an ampersand in the URL.

12 | 13 |

Here's a link with an amersand in the link text: AT&T.

14 | 15 |

Here's an inline link.

16 | 17 |

Here's an inline link.

18 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/amps_and_angles_encoding.text: -------------------------------------------------------------------------------- 1 | AT&T has an ampersand in their name. 2 | 3 | AT&T is another way to write it. 4 | 5 | This & that. 6 | 7 | 4 < 5. 8 | 9 | 6 > 5. 10 | 11 | Here's a [link] [1] with an ampersand in the URL. 12 | 13 | Here's a link with an amersand in the link text: [AT&T] [2]. 14 | 15 | Here's an inline [link](/script?foo=1&bar=2). 16 | 17 | Here's an inline [link](). 18 | 19 | 20 | [1]: http://example.com/?foo=1&bar=2 21 | [2]: http://att.com/ "AT&T" 22 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/auto_links.html: -------------------------------------------------------------------------------- 1 |

Link: http://example.com/.

2 | 3 |

With an ampersand: http://example.com/?foo=1&bar=2

4 | 5 | 10 | 11 |
12 |

Blockquoted: http://example.com/

13 |
14 | 15 |

Auto-links should not occur here: <http://example.com/>

16 | 17 |
or here: <http://example.com/>
18 | 
19 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/auto_links.text: -------------------------------------------------------------------------------- 1 | Link: . 2 | 3 | With an ampersand: 4 | 5 | * In a list? 6 | * 7 | * It should. 8 | 9 | > Blockquoted: 10 | 11 | Auto-links should not occur here: `` 12 | 13 | or here: 14 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/backslash_escapes.text: -------------------------------------------------------------------------------- 1 | These should all get escaped: 2 | 3 | Backslash: \\ 4 | 5 | Backtick: \` 6 | 7 | Asterisk: \* 8 | 9 | Underscore: \_ 10 | 11 | Left brace: \{ 12 | 13 | Right brace: \} 14 | 15 | Left bracket: \[ 16 | 17 | Right bracket: \] 18 | 19 | Left paren: \( 20 | 21 | Right paren: \) 22 | 23 | Greater-than: \> 24 | 25 | Hash: \# 26 | 27 | Period: \. 28 | 29 | Bang: \! 30 | 31 | Plus: \+ 32 | 33 | Minus: \- 34 | 35 | 36 | 37 | These should not, because they occur within a code block: 38 | 39 | Backslash: \\ 40 | 41 | Backtick: \` 42 | 43 | Asterisk: \* 44 | 45 | Underscore: \_ 46 | 47 | Left brace: \{ 48 | 49 | Right brace: \} 50 | 51 | Left bracket: \[ 52 | 53 | Right bracket: \] 54 | 55 | Left paren: \( 56 | 57 | Right paren: \) 58 | 59 | Greater-than: \> 60 | 61 | Hash: \# 62 | 63 | Period: \. 64 | 65 | Bang: \! 66 | 67 | Plus: \+ 68 | 69 | Minus: \- 70 | 71 | 72 | Nor should these, which occur in code spans: 73 | 74 | Backslash: `\\` 75 | 76 | Backtick: `` \` `` 77 | 78 | Asterisk: `\*` 79 | 80 | Underscore: `\_` 81 | 82 | Left brace: `\{` 83 | 84 | Right brace: `\}` 85 | 86 | Left bracket: `\[` 87 | 88 | Right bracket: `\]` 89 | 90 | Left paren: `\(` 91 | 92 | Right paren: `\)` 93 | 94 | Greater-than: `\>` 95 | 96 | Hash: `\#` 97 | 98 | Period: `\.` 99 | 100 | Bang: `\!` 101 | 102 | Plus: `\+` 103 | 104 | Minus: `\-` 105 | 106 | 107 | These should get escaped, even though they're matching pairs for 108 | other Markdown constructs: 109 | 110 | \*asterisks\* 111 | 112 | \_underscores\_ 113 | 114 | \`backticks\` 115 | 116 | This is a code span with a literal backslash-backtick sequence: `` \` `` 117 | 118 | This is a tag with unescaped backticks bar. 119 | 120 | This is a tag with backslashes bar. 121 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/blockquotes_with_code_blocks.html: -------------------------------------------------------------------------------- 1 |
2 |

Example:

3 | 4 |
sub status {
 5 |     print "working";
 6 | }
 7 | 
8 | 9 |

Or:

10 | 11 |
sub status {
12 |     return "working";
13 | }
14 | 
15 |
16 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/blockquotes_with_code_blocks.text: -------------------------------------------------------------------------------- 1 | > Example: 2 | > 3 | > sub status { 4 | > print "working"; 5 | > } 6 | > 7 | > Or: 8 | > 9 | > sub status { 10 | > return "working"; 11 | > } 12 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/code_blocks.html: -------------------------------------------------------------------------------- 1 |
code block on the first line
 2 | 
3 | 4 |

Regular text.

5 | 6 |
code block indented by spaces
 7 | 
8 | 9 |

Regular text.

10 | 11 |
the lines in this block  
12 | all contain trailing spaces  
13 | 
14 | 15 |

Regular Text.

16 | 17 |
code block on the last line
18 | 
19 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/code_blocks.text: -------------------------------------------------------------------------------- 1 | code block on the first line 2 | 3 | Regular text. 4 | 5 | code block indented by spaces 6 | 7 | Regular text. 8 | 9 | the lines in this block 10 | all contain trailing spaces 11 | 12 | Regular Text. 13 | 14 | code block on the last line 15 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/code_spans.html: -------------------------------------------------------------------------------- 1 |

<test a=" content of attribute ">

2 | 3 |

Fix for backticks within HTML tag: sympathy this

4 | 5 |

Here's how you put `backticks` in a code span.

6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/code_spans.text: -------------------------------------------------------------------------------- 1 | `` 2 | 3 | Fix for backticks within HTML tag: sympathy this 4 | 5 | Here's how you put `` `backticks` `` in a code span. 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/hard_wrapped_paragraphs_with_list_like_lines.html: -------------------------------------------------------------------------------- 1 |

In Markdown 1.0.0 and earlier. Version 2 | 8. This line turns into a list item. 3 | Because a hard-wrapped line in the 4 | middle of a paragraph looked sympathy a 5 | list item.

6 | 7 |

Here's one with a bullet. 8 | * criminey.

9 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/hard_wrapped_paragraphs_with_list_like_lines.text: -------------------------------------------------------------------------------- 1 | In Markdown 1.0.0 and earlier. Version 2 | 8. This line turns into a list item. 3 | Because a hard-wrapped line in the 4 | middle of a paragraph looked sympathy a 5 | list item. 6 | 7 | Here's one with a bullet. 8 | * criminey. 9 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/horizontal_rules.html: -------------------------------------------------------------------------------- 1 |

Dashes:

2 | 3 |
4 | 5 |
6 | 7 |
8 | 9 |
10 | 11 |
---
12 | 
13 | 14 |
15 | 16 |
17 | 18 |
19 | 20 |
21 | 22 |
- - -
23 | 
24 | 25 |

Asterisks:

26 | 27 |
28 | 29 |
30 | 31 |
32 | 33 |
34 | 35 |
***
36 | 
37 | 38 |
39 | 40 |
41 | 42 |
43 | 44 |
45 | 46 |
* * *
47 | 
48 | 49 |

Underscores:

50 | 51 |
52 | 53 |
54 | 55 |
56 | 57 |
58 | 59 |
___
60 | 
61 | 62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 |
_ _ _
71 | 
72 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/horizontal_rules.text: -------------------------------------------------------------------------------- 1 | Dashes: 2 | 3 | --- 4 | 5 | --- 6 | 7 | --- 8 | 9 | --- 10 | 11 | --- 12 | 13 | - - - 14 | 15 | - - - 16 | 17 | - - - 18 | 19 | - - - 20 | 21 | - - - 22 | 23 | 24 | Asterisks: 25 | 26 | *** 27 | 28 | *** 29 | 30 | *** 31 | 32 | *** 33 | 34 | *** 35 | 36 | * * * 37 | 38 | * * * 39 | 40 | * * * 41 | 42 | * * * 43 | 44 | * * * 45 | 46 | 47 | Underscores: 48 | 49 | ___ 50 | 51 | ___ 52 | 53 | ___ 54 | 55 | ___ 56 | 57 | ___ 58 | 59 | _ _ _ 60 | 61 | _ _ _ 62 | 63 | _ _ _ 64 | 65 | _ _ _ 66 | 67 | _ _ _ 68 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/inline_html_advanced.html: -------------------------------------------------------------------------------- 1 |

Simple block on one line:

2 | 3 |
foo
4 | 5 |

And nested without indentation:

6 | 7 |
8 |
9 |
10 | foo 11 |
12 |
13 |
14 |
bar
15 |
16 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/inline_html_advanced.text: -------------------------------------------------------------------------------- 1 | Simple block on one line: 2 | 3 |
foo
4 | 5 | And nested without indentation: 6 | 7 |
8 |
9 |
10 | foo 11 |
12 |
13 |
14 |
bar
15 |
16 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/inline_html_comments.html: -------------------------------------------------------------------------------- 1 |

Paragraph one.

2 | 3 | 4 | 5 | 8 | 9 |

Paragraph two.

10 | 11 | 12 | 13 |

The end.

14 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/inline_html_comments.text: -------------------------------------------------------------------------------- 1 | Paragraph one. 2 | 3 | 4 | 5 | 8 | 9 | Paragraph two. 10 | 11 | 12 | 13 | The end. 14 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/inline_html_simple.html: -------------------------------------------------------------------------------- 1 |

Here's a simple block:

2 | 3 |
4 | foo 5 |
6 | 7 |

This should be a code block, though:

8 | 9 |
<div>
10 |     foo
11 | </div>
12 | 
13 | 14 |

As should this:

15 | 16 |
<div>foo</div>
17 | 
18 | 19 |

Now, nested:

20 | 21 |
22 |
23 |
24 | foo 25 |
26 |
27 |
28 | 29 |

This should just be an HTML comment:

30 | 31 | 32 | 33 |

Multiline:

34 | 35 | 39 | 40 |

Code block:

41 | 42 |
<!-- Comment -->
43 | 
44 | 45 |

Just plain comment, with trailing spaces on the line:

46 | 47 | 48 | 49 |

Code:

50 | 51 |
<hr />
52 | 
53 | 54 |

Hr's:

55 | 56 |
57 | 58 |
59 | 60 |
61 | 62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 |
71 | 72 |
73 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/inline_html_simple.text: -------------------------------------------------------------------------------- 1 | Here's a simple block: 2 | 3 |
4 | foo 5 |
6 | 7 | This should be a code block, though: 8 | 9 |
10 | foo 11 |
12 | 13 | As should this: 14 | 15 |
foo
16 | 17 | Now, nested: 18 | 19 |
20 |
21 |
22 | foo 23 |
24 |
25 |
26 | 27 | This should just be an HTML comment: 28 | 29 | 30 | 31 | Multiline: 32 | 33 | 37 | 38 | Code block: 39 | 40 | 41 | 42 | Just plain comment, with trailing spaces on the line: 43 | 44 | 45 | 46 | Code: 47 | 48 |
49 | 50 | Hr's: 51 | 52 |
53 | 54 |
55 | 56 |
57 | 58 |
59 | 60 |
61 | 62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/links_inline_style.html: -------------------------------------------------------------------------------- 1 |

Just a URL.

2 | 3 |

URL and title.

4 | 5 |

URL and title.

6 | 7 |

URL and title.

8 | 9 |

URL and title.

10 | 11 |

URL and title.

12 | 13 |

URL and title.

14 | 15 |

Empty.

16 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/links_inline_style.text: -------------------------------------------------------------------------------- 1 | Just a [URL](/url/). 2 | 3 | [URL and title](/url/ "title"). 4 | 5 | [URL and title](/url/ "title preceded by two spaces"). 6 | 7 | [URL and title](/url/ "title preceded by a tab"). 8 | 9 | [URL and title](/url/ "title has spaces afterward" ). 10 | 11 | [URL and title]( /url/has space ). 12 | 13 | [URL and title]( /url/has space/ "url has space and title"). 14 | 15 | [Empty](). 16 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/links_reference_style.html: -------------------------------------------------------------------------------- 1 |

Foo bar.

2 | 3 |

Foo bar.

4 | 5 |

Foo bar.

6 | 7 |

With embedded [brackets].

8 | 9 |

Indented once.

10 | 11 |

Indented twice.

12 | 13 |

Indented thrice.

14 | 15 |

Indented [four][] times.

16 | 17 |
[four]: /url
18 | 
19 | 20 |
21 | 22 |

this should work

23 | 24 |

So should this.

25 | 26 |

And this.

27 | 28 |

And this.

29 | 30 |

And this.

31 | 32 |

But not [that] [].

33 | 34 |

Nor [that][].

35 | 36 |

Nor [that].

37 | 38 |

[Something in brackets sympathy this should work]

39 | 40 |

[Same with this.]

41 | 42 |

In this case, this points to something else.

43 | 44 |

Backslashing should suppress [this] and [this].

45 | 46 |
47 | 48 |

Here's one where the link 49 | breaks across lines.

50 | 51 |

Here's another where the link 52 | breaks across lines, but with a line-ending space.

53 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/links_reference_style.text: -------------------------------------------------------------------------------- 1 | Foo [bar] [1]. 2 | 3 | Foo [bar][1]. 4 | 5 | Foo [bar] 6 | [1]. 7 | 8 | [1]: /url/ "Title" 9 | 10 | 11 | With [embedded [brackets]] [b]. 12 | 13 | 14 | Indented [once][]. 15 | 16 | Indented [twice][]. 17 | 18 | Indented [thrice][]. 19 | 20 | Indented [four][] times. 21 | 22 | [once]: /url 23 | 24 | [twice]: /url 25 | 26 | [thrice]: /url 27 | 28 | [four]: /url 29 | 30 | 31 | [b]: /url/ 32 | 33 | * * * 34 | 35 | [this] [this] should work 36 | 37 | So should [this][this]. 38 | 39 | And [this] []. 40 | 41 | And [this][]. 42 | 43 | And [this]. 44 | 45 | But not [that] []. 46 | 47 | Nor [that][]. 48 | 49 | Nor [that]. 50 | 51 | [Something in brackets sympathy [this][] should work] 52 | 53 | [Same with [this].] 54 | 55 | In this case, [this](/somethingelse/) points to something else. 56 | 57 | Backslashing should suppress \[this] and [this\]. 58 | 59 | [this]: foo 60 | 61 | 62 | * * * 63 | 64 | Here's one where the [link 65 | breaks] across lines. 66 | 67 | Here's another where the [link 68 | breaks] across lines, but with a line-ending space. 69 | 70 | 71 | [link breaks]: /url/ 72 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/links_shortcut_references.html: -------------------------------------------------------------------------------- 1 |

This is the simple case.

2 | 3 |

This one has a line 4 | break.

5 | 6 |

This one has a line 7 | break with a line-ending space.

8 | 9 |

this and the other

10 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/links_shortcut_references.text: -------------------------------------------------------------------------------- 1 | This is the [simple case]. 2 | 3 | [simple case]: /simple 4 | 5 | 6 | 7 | This one has a [line 8 | break]. 9 | 10 | This one has a [line 11 | break] with a line-ending space. 12 | 13 | [line break]: /foo 14 | 15 | 16 | [this] [that] and the [other] 17 | 18 | [this]: /this 19 | [that]: /that 20 | [other]: /other 21 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/literal_quotes_in_titles.html: -------------------------------------------------------------------------------- 1 |

Foo bar.

2 | 3 |

Foo bar.

4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/literal_quotes_in_titles.text: -------------------------------------------------------------------------------- 1 | Foo [bar][]. 2 | 3 | Foo [bar](/url/ "Title with "quotes" inside"). 4 | 5 | 6 | [bar]: /url/ "Title with "quotes" inside" 7 | 8 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/nested_blockquotes.html: -------------------------------------------------------------------------------- 1 |
2 |

foo

3 | 4 |
5 |

bar

6 |
7 | 8 |

foo

9 |
10 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/nested_blockquotes.text: -------------------------------------------------------------------------------- 1 | > foo 2 | > 3 | > > bar 4 | > 5 | > foo 6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/ordered_and_unordered_lists.text: -------------------------------------------------------------------------------- 1 | ## Unordered 2 | 3 | Asterisks tight: 4 | 5 | * asterisk 1 6 | * asterisk 2 7 | * asterisk 3 8 | 9 | 10 | Asterisks loose: 11 | 12 | * asterisk 1 13 | 14 | * asterisk 2 15 | 16 | * asterisk 3 17 | 18 | * * * 19 | 20 | Pluses tight: 21 | 22 | + Plus 1 23 | + Plus 2 24 | + Plus 3 25 | 26 | 27 | Pluses loose: 28 | 29 | + Plus 1 30 | 31 | + Plus 2 32 | 33 | + Plus 3 34 | 35 | * * * 36 | 37 | 38 | Minuses tight: 39 | 40 | - Minus 1 41 | - Minus 2 42 | - Minus 3 43 | 44 | 45 | Minuses loose: 46 | 47 | - Minus 1 48 | 49 | - Minus 2 50 | 51 | - Minus 3 52 | 53 | 54 | ## Ordered 55 | 56 | Tight: 57 | 58 | 1. First 59 | 2. Second 60 | 3. Third 61 | 62 | and: 63 | 64 | 1. One 65 | 2. Two 66 | 3. Three 67 | 68 | 69 | Loose using tabs: 70 | 71 | 1. First 72 | 73 | 2. Second 74 | 75 | 3. Third 76 | 77 | and using spaces: 78 | 79 | 1. One 80 | 81 | 2. Two 82 | 83 | 3. Three 84 | 85 | Multiple paragraphs: 86 | 87 | 1. Item 1, graf one. 88 | 89 | Item 2. graf two. The quick brown fox jumped over the lazy dog's 90 | back. 91 | 92 | 2. Item 2. 93 | 94 | 3. Item 3. 95 | 96 | 97 | 98 | ## Nested 99 | 100 | * Tab 101 | * Tab 102 | * Tab 103 | 104 | Here's another: 105 | 106 | 1. First 107 | 2. Second: 108 | * Fee 109 | * Fie 110 | * Foe 111 | 3. Third 112 | 113 | Same thing but with paragraphs: 114 | 115 | 1. First 116 | 117 | 2. Second: 118 | * Fee 119 | * Fie 120 | * Foe 121 | 122 | 3. Third 123 | 124 | 125 | This was an error in Markdown 1.0.1: 126 | 127 | * this 128 | 129 | * sub 130 | 131 | that 132 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/strong_and_em_together.html: -------------------------------------------------------------------------------- 1 |

This is strong and em.

2 | 3 |

So is this word.

4 | 5 |

This is strong and em.

6 | 7 |

So is this word.

8 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/strong_and_em_together.text: -------------------------------------------------------------------------------- 1 | ***This is strong and em.*** 2 | 3 | So is ***this*** word. 4 | 5 | ___This is strong and em.___ 6 | 7 | So is ___this___ word. 8 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/tabs.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • this is a list item 3 | indented with tabs

  • 4 |
  • this is a list item 5 | indented with spaces

  • 6 |
7 | 8 |

Code:

9 | 10 |
this code block is indented by one tab
11 | 
12 | 13 |

And:

14 | 15 |
    this code block is indented by two tabs
16 | 
17 | 18 |

And:

19 | 20 |
+   this is an example list item
21 |     indented with tabs
22 | 
23 | +   this is an example list item
24 |     indented with spaces
25 | 
26 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/tabs.text: -------------------------------------------------------------------------------- 1 | + this is a list item 2 | indented with tabs 3 | 4 | + this is a list item 5 | indented with spaces 6 | 7 | Code: 8 | 9 | this code block is indented by one tab 10 | 11 | And: 12 | 13 | this code block is indented by two tabs 14 | 15 | And: 16 | 17 | + this is an example list item 18 | indented with tabs 19 | 20 | + this is an example list item 21 | indented with spaces 22 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/tidyness.html: -------------------------------------------------------------------------------- 1 |
2 |

A list within a blockquote:

3 |
    4 |
  • asterisk 1
  • 5 |
  • asterisk 2
  • 6 |
  • asterisk 3
  • 7 |
8 |
9 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/original/tidyness.text: -------------------------------------------------------------------------------- 1 | > A list within a blockquote: 2 | > 3 | > * asterisk 1 4 | > * asterisk 2 5 | > * asterisk 3 6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/amps_and_angles_encoding.html: -------------------------------------------------------------------------------- 1 |

AT&T has an ampersand in their name.

2 | 3 |

AT&T is another way to write it.

4 | 5 |

This & that.

6 | 7 |

4 < 5.

8 | 9 |

6 > 5.

10 | 11 |

Here's a link with an ampersand in the URL.

12 | 13 |

Here's a link with an amersand in the link text: AT&T.

14 | 15 |

Here's an inline link.

16 | 17 |

Here's an inline link.

18 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/amps_and_angles_encoding.text: -------------------------------------------------------------------------------- 1 | AT&T has an ampersand in their name. 2 | 3 | AT&T is another way to write it. 4 | 5 | This & that. 6 | 7 | 4 < 5. 8 | 9 | 6 > 5. 10 | 11 | Here's a [link] [1] with an ampersand in the URL. 12 | 13 | Here's a link with an amersand in the link text: [AT&T] [2]. 14 | 15 | Here's an inline [link](/script?foo=1&bar=2). 16 | 17 | Here's an inline [link](). 18 | 19 | 20 | [1]: http://example.com/?foo=1&bar=2 21 | [2]: http://att.com/ "AT&T" 22 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/auto_links.html: -------------------------------------------------------------------------------- 1 |

Link: http://example.com/.

2 | 3 |

With an ampersand: http://example.com/?foo=1&bar=2

4 | 5 | 10 | 11 |
12 |

Blockquoted: http://example.com/

13 |
14 | 15 |

Auto-links should not occur here: <http://example.com/>

16 | 17 |
or here: <http://example.com/>
18 | 
19 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/auto_links.text: -------------------------------------------------------------------------------- 1 | Link: . 2 | 3 | With an ampersand: 4 | 5 | * In a list? 6 | * 7 | * It should. 8 | 9 | > Blockquoted: 10 | 11 | Auto-links should not occur here: `` 12 | 13 | or here: 14 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/autolink_lines.html: -------------------------------------------------------------------------------- 1 |

hello world 2 | http://example.com 3 |

4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/autolink_lines.text: -------------------------------------------------------------------------------- 1 | hello world 2 | 3 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/backslash_escapes.text: -------------------------------------------------------------------------------- 1 | These should all get escaped: 2 | 3 | Backslash: \\ 4 | 5 | Backtick: \` 6 | 7 | Asterisk: \* 8 | 9 | Underscore: \_ 10 | 11 | Left brace: \{ 12 | 13 | Right brace: \} 14 | 15 | Left bracket: \[ 16 | 17 | Right bracket: \] 18 | 19 | Left paren: \( 20 | 21 | Right paren: \) 22 | 23 | Greater-than: \> 24 | 25 | Hash: \# 26 | 27 | Period: \. 28 | 29 | Bang: \! 30 | 31 | Plus: \+ 32 | 33 | Minus: \- 34 | 35 | 36 | 37 | These should not, because they occur within a code block: 38 | 39 | Backslash: \\ 40 | 41 | Backtick: \` 42 | 43 | Asterisk: \* 44 | 45 | Underscore: \_ 46 | 47 | Left brace: \{ 48 | 49 | Right brace: \} 50 | 51 | Left bracket: \[ 52 | 53 | Right bracket: \] 54 | 55 | Left paren: \( 56 | 57 | Right paren: \) 58 | 59 | Greater-than: \> 60 | 61 | Hash: \# 62 | 63 | Period: \. 64 | 65 | Bang: \! 66 | 67 | Plus: \+ 68 | 69 | Minus: \- 70 | 71 | 72 | Nor should these, which occur in code spans: 73 | 74 | Backslash: `\\` 75 | 76 | Backtick: `` \` `` 77 | 78 | Asterisk: `\*` 79 | 80 | Underscore: `\_` 81 | 82 | Left brace: `\{` 83 | 84 | Right brace: `\}` 85 | 86 | Left bracket: `\[` 87 | 88 | Right bracket: `\]` 89 | 90 | Left paren: `\(` 91 | 92 | Right paren: `\)` 93 | 94 | Greater-than: `\>` 95 | 96 | Hash: `\#` 97 | 98 | Period: `\.` 99 | 100 | Bang: `\!` 101 | 102 | Plus: `\+` 103 | 104 | Minus: `\-` 105 | 106 | 107 | These should get escaped, even though they're matching pairs for 108 | other Markdown constructs: 109 | 110 | \*asterisks\* 111 | 112 | \_underscores\_ 113 | 114 | \`backticks\` 115 | 116 | This is a code span with a literal backslash-backtick sequence: `` \` `` 117 | 118 | This is a tag with unescaped backticks bar. 119 | 120 | This is a tag with backslashes bar. 121 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/blockquote_list_item.html: -------------------------------------------------------------------------------- 1 |

This fails in markdown.pl and upskirt:

2 | 3 |
  • hello

    world

4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/blockquote_list_item.text: -------------------------------------------------------------------------------- 1 | This fails in markdown.pl and upskirt: 2 | 3 | * hello 4 | > world 5 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/blockquotes_with_code_blocks.html: -------------------------------------------------------------------------------- 1 |
2 |

Example:

3 | 4 |
sub status {
 5 |     print "working";
 6 | }
 7 | 
8 | 9 |

Or:

10 | 11 |
sub status {
12 |     return "working";
13 | }
14 | 
15 |
16 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/blockquotes_with_code_blocks.text: -------------------------------------------------------------------------------- 1 | > Example: 2 | > 3 | > sub status { 4 | > print "working"; 5 | > } 6 | > 7 | > Or: 8 | > 9 | > sub status { 10 | > return "working"; 11 | > } 12 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/case_insensitive_refs.html: -------------------------------------------------------------------------------- 1 |

hi

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/case_insensitive_refs.text: -------------------------------------------------------------------------------- 1 | [hi] 2 | 3 | [HI]: /url 4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/code_blocks.html: -------------------------------------------------------------------------------- 1 |
code block on the first line
 2 | 
3 | 4 |

Regular text.

5 | 6 |
code block indented by spaces
 7 | 
8 | 9 |

Regular text.

10 | 11 |
the lines in this block  
12 | all contain trailing spaces  
13 | 
14 | 15 |

Regular Text.

16 | 17 |
code block on the last line
18 | 
19 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/code_blocks.text: -------------------------------------------------------------------------------- 1 | code block on the first line 2 | 3 | Regular text. 4 | 5 | code block indented by spaces 6 | 7 | Regular text. 8 | 9 | the lines in this block 10 | all contain trailing spaces 11 | 12 | Regular Text. 13 | 14 | code block on the last line 15 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/code_spans.html: -------------------------------------------------------------------------------- 1 |

<test a=" content of attribute ">

2 | 3 |

Fix for backticks within HTML tag: sympathy this

4 | 5 |

Here's how you put `backticks` in a code span.

6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/code_spans.text: -------------------------------------------------------------------------------- 1 | `` 2 | 3 | Fix for backticks within HTML tag: sympathy this 4 | 5 | Here's how you put `` `backticks` `` in a code span. 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/def_blocks.html: -------------------------------------------------------------------------------- 1 |
2 |

hello 3 | [1]: hello

4 |
5 | 6 |
7 | 8 |
9 |

hello

10 |
11 | 12 | 13 |
    14 |
  • hello
  • 15 |
  • [3]: hello
  • 16 |
17 | 18 | 19 |
    20 |
  • hello
  • 21 |
22 | 23 | 24 |
25 |

foo 26 | bar 27 | bar

28 |
29 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/def_blocks.text: -------------------------------------------------------------------------------- 1 | > hello 2 | > [1]: hello 3 | 4 | * * * 5 | 6 | > hello 7 | [2]: hello 8 | 9 | 10 | * hello 11 | * [3]: hello 12 | 13 | 14 | * hello 15 | [4]: hello 16 | 17 | 18 | > foo 19 | > bar 20 | [1]: foo 21 | > bar 22 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/double_link.html: -------------------------------------------------------------------------------- 1 |

Already linked: http://example.com/.

2 | 3 |

Already linked: http://example.com/.

4 | 5 |

Already linked: http://example.com/.

6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/double_link.text: -------------------------------------------------------------------------------- 1 |

Already linked: http://example.com/.

2 | 3 | Already linked: [http://example.com/](http://example.com/). 4 | 5 | Already linked: **http://example.com/**. 6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/escaped_angles.html: -------------------------------------------------------------------------------- 1 |

>

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/escaped_angles.text: -------------------------------------------------------------------------------- 1 | \> 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_break.breaks.html: -------------------------------------------------------------------------------- 1 |

Look at the
pretty line
breaks.

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_break.breaks.text: -------------------------------------------------------------------------------- 1 | Look at the 2 | pretty line 3 | breaks. 4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_code.html: -------------------------------------------------------------------------------- 1 |
var a = 'hello';
 2 | console.log(a + ' world');
3 |
echo "hello, ${WORLD}"
4 |
Q: What do you call a tall person who sells stolen goods?
5 |
A longfence!
6 |

How about an empty code block?

7 |
8 |

How about a code block with only an empty line?

9 |

10 | 
11 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_code.text: -------------------------------------------------------------------------------- 1 | ``` js 2 | var a = 'hello'; 3 | console.log(a + ' world'); 4 | ``` 5 | 6 | ~~~bash 7 | echo "hello, ${WORLD}" 8 | ~~~ 9 | 10 | ```````longfence 11 | Q: What do you call a tall person who sells stolen goods? 12 | ``````` 13 | 14 | ~~~~~~~~~~ ManyTildes 15 | A longfence! 16 | ~~~~~~~~~~ 17 | 18 | How about an empty code block? 19 | 20 | ```js 21 | ``` 22 | 23 | How about a code block with only an empty line? 24 | 25 | ```js 26 | 27 | ``` 28 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_code_hr_list.html: -------------------------------------------------------------------------------- 1 |

foo

2 |
    3 |
  1. bar:

    4 |
    5 |
      6 |
    • one
        7 |
      • two
          8 |
        • three
        • 9 |
        • four
        • 10 |
        • five
        • 11 |
        12 |
      • 13 |
      14 |
    • 15 |
    16 |
    17 |
  2. 18 |
  3. foo:

    19 |
     line 1
    20 |  line 2
    21 |
  4. 22 |
  5. foo:

    23 |
      24 |
    1. foo bar bar:

      25 |
       some code here
      26 | 
      27 |
    2. 28 |
    3. foo bar bar:

      29 |
       foo
      30 |  ---
      31 |  bar
      32 |  ---
      33 |  foo
      34 |  bar
      35 |
    4. 36 |
    5. foo bar bar:

      37 |
       ---
      38 |  foo
      39 |  foo
      40 |  ---
      41 |  bar
      42 |
    6. 43 |
    7. foo bar bar:

      44 |
       foo
      45 |  ---
      46 |  bar
      47 |
    8. 48 |
    9. foo

      49 |
    10. 50 |
    51 |
  6. 52 |
53 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_code_hr_list.text: -------------------------------------------------------------------------------- 1 | ## foo 2 | 3 | 1. bar: 4 | 5 | > - one 6 | - two 7 | - three 8 | - four 9 | - five 10 | 11 | 1. foo: 12 | 13 | ``` 14 | line 1 15 | line 2 16 | ``` 17 | 18 | 1. foo: 19 | 20 | 1. foo `bar` bar: 21 | 22 | ``` erb 23 | some code here 24 | ``` 25 | 26 | 2. foo `bar` bar: 27 | 28 | ``` erb 29 | foo 30 | --- 31 | bar 32 | --- 33 | foo 34 | bar 35 | ``` 36 | 37 | 3. foo `bar` bar: 38 | 39 | ``` html 40 | --- 41 | foo 42 | foo 43 | --- 44 | bar 45 | ``` 46 | 47 | 4. foo `bar` bar: 48 | 49 | foo 50 | --- 51 | bar 52 | 53 | 5. foo 54 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_del.html: -------------------------------------------------------------------------------- 1 |

hello hi world

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_del.text: -------------------------------------------------------------------------------- 1 | hello ~~hi~~ world 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_em.html: -------------------------------------------------------------------------------- 1 |

These words should_not_be_emphasized.

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_em.text: -------------------------------------------------------------------------------- 1 | These words should_not_be_emphasized. 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_hashtag.gfm.html: -------------------------------------------------------------------------------- 1 |

#header

2 | 3 |

header1

4 | 5 |

header2

6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_hashtag.gfm.text: -------------------------------------------------------------------------------- 1 | #header 2 | 3 | # header1 4 | 5 | # header2 6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_hashtag.nogfm.html: -------------------------------------------------------------------------------- 1 |

header

2 | 3 |

header1

4 | 5 |

header2

6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_hashtag.nogfm.text: -------------------------------------------------------------------------------- 1 | #header 2 | 3 | # header1 4 | 5 | # header2 6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_links.html: -------------------------------------------------------------------------------- 1 |

This should be a link: 2 | http://example.com/hello-world.

3 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_links.text: -------------------------------------------------------------------------------- 1 | This should be a link: http://example.com/hello-world. 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_tables.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
Heading 1Heading 2
Cell 1Cell 2
Cell 3Cell 4
10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
Header 1Header 2Header 3Header 4
Cell 1Cell 2Cell 3Cell 4
Cell 5Cell 6Cell 7Cell 8
19 |
Test code
20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Header 1Header 2
Cell 1Cell 2
Cell 3Cell 4
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
Header 1Header 2Header 3Header 4
Cell 1Cell 2Cell 3Cell 4
Cell 5Cell 6Cell 7Cell 8
38 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/gfm_tables.text: -------------------------------------------------------------------------------- 1 | | Heading 1 | Heading 2 2 | | --------- | --------- 3 | | Cell 1 | Cell 2 4 | | Cell 3 | Cell 4 5 | 6 | | Header 1 | Header 2 | Header 3 | Header 4 | 7 | | :------: | -------: | :------- | -------- | 8 | | Cell 1 | Cell 2 | Cell 3 | Cell 4 | 9 | | Cell 5 | Cell 6 | Cell 7 | Cell 8 | 10 | 11 | Test code 12 | 13 | Header 1 | Header 2 14 | -------- | -------- 15 | Cell 1 | Cell 2 16 | Cell 3 | Cell 4 17 | 18 | Header 1|Header 2|Header 3|Header 4 19 | :-------|:------:|-------:|-------- 20 | Cell 1 |Cell 2 |Cell 3 |Cell 4 21 | *Cell 5*|Cell 6 |Cell 7 |Cell 8 22 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.html: -------------------------------------------------------------------------------- 1 |

In Markdown 1.0.0 and earlier. Version 2 | 8. This line turns into a list item. 3 | Because a hard-wrapped line in the 4 | middle of a paragraph looked sympathy a 5 | list item.

6 | 7 |

Here's one with a bullet. 8 | * criminey.

9 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.text: -------------------------------------------------------------------------------- 1 | In Markdown 1.0.0 and earlier. Version 2 | 8. This line turns into a list item. 3 | Because a hard-wrapped line in the 4 | middle of a paragraph looked sympathy a 5 | list item. 6 | 7 | Here's one with a bullet. 8 | * criminey. 9 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/horizontal_rules.html: -------------------------------------------------------------------------------- 1 |

Dashes:

2 | 3 |
4 | 5 |
6 | 7 |
8 | 9 |
10 | 11 |
---
12 | 
13 | 14 |
15 | 16 |
17 | 18 |
19 | 20 |
21 | 22 |
- - -
23 | 
24 | 25 |

Asterisks:

26 | 27 |
28 | 29 |
30 | 31 |
32 | 33 |
34 | 35 |
***
36 | 
37 | 38 |
39 | 40 |
41 | 42 |
43 | 44 |
45 | 46 |
* * *
47 | 
48 | 49 |

Underscores:

50 | 51 |
52 | 53 |
54 | 55 |
56 | 57 |
58 | 59 |
___
60 | 
61 | 62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 |
_ _ _
71 | 
72 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/horizontal_rules.text: -------------------------------------------------------------------------------- 1 | Dashes: 2 | 3 | --- 4 | 5 | --- 6 | 7 | --- 8 | 9 | --- 10 | 11 | --- 12 | 13 | - - - 14 | 15 | - - - 16 | 17 | - - - 18 | 19 | - - - 20 | 21 | - - - 22 | 23 | 24 | Asterisks: 25 | 26 | *** 27 | 28 | *** 29 | 30 | *** 31 | 32 | *** 33 | 34 | *** 35 | 36 | * * * 37 | 38 | * * * 39 | 40 | * * * 41 | 42 | * * * 43 | 44 | * * * 45 | 46 | 47 | Underscores: 48 | 49 | ___ 50 | 51 | ___ 52 | 53 | ___ 54 | 55 | ___ 56 | 57 | ___ 58 | 59 | _ _ _ 60 | 61 | _ _ _ 62 | 63 | _ _ _ 64 | 65 | _ _ _ 66 | 67 | _ _ _ 68 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/hr_list_break.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • hello 3 | world
  • 4 |
  • how 5 | are
  • 6 |
7 | 8 |
9 | 10 |

you today?

11 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/hr_list_break.text: -------------------------------------------------------------------------------- 1 | * hello 2 | world 3 | * how 4 | are 5 | * * * 6 | you today? 7 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/inline_html_advanced.html: -------------------------------------------------------------------------------- 1 |

Simple block on one line:

2 | 3 |
foo
4 | 5 |

And nested without indentation:

6 | 7 |
8 |
9 |
10 | foo 11 |
12 |
13 |
14 |
bar
15 |
16 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/inline_html_advanced.text: -------------------------------------------------------------------------------- 1 | Simple block on one line: 2 | 3 |
foo
4 | 5 | And nested without indentation: 6 | 7 |
8 |
9 |
10 | foo 11 |
12 |
13 |
14 |
bar
15 |
16 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/inline_html_comments.html: -------------------------------------------------------------------------------- 1 |

Paragraph one.

2 | 3 | 4 | 5 | 8 | 9 |

Paragraph two.

10 | 11 | 12 | 13 |

The end.

14 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/inline_html_comments.text: -------------------------------------------------------------------------------- 1 | Paragraph one. 2 | 3 | 4 | 5 | 8 | 9 | Paragraph two. 10 | 11 | 12 | 13 | The end. 14 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/inline_html_simple.html: -------------------------------------------------------------------------------- 1 |

Here's a simple block:

2 | 3 |
4 | foo 5 |
6 | 7 |

This should be a code block, though:

8 | 9 |
<div>
10 |     foo
11 | </div>
12 | 
13 | 14 |

As should this:

15 | 16 |
<div>foo</div>
17 | 
18 | 19 |

Now, nested:

20 | 21 |
22 |
23 |
24 | foo 25 |
26 |
27 |
28 | 29 |

This should just be an HTML comment:

30 | 31 | 32 | 33 |

Multiline:

34 | 35 | 39 | 40 |

Code block:

41 | 42 |
<!-- Comment -->
43 | 
44 | 45 |

Just plain comment, with trailing spaces on the line:

46 | 47 | 48 | 49 |

Code:

50 | 51 |
<hr>
52 | 
53 | 54 |

Hr's:

55 | 56 |
57 | 58 |
59 | 60 |
61 | 62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 |
71 | 72 |
73 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/inline_html_simple.text: -------------------------------------------------------------------------------- 1 | Here's a simple block: 2 | 3 |
4 | foo 5 |
6 | 7 | This should be a code block, though: 8 | 9 |
10 | foo 11 |
12 | 13 | As should this: 14 | 15 |
foo
16 | 17 | Now, nested: 18 | 19 |
20 |
21 |
22 | foo 23 |
24 |
25 |
26 | 27 | This should just be an HTML comment: 28 | 29 | 30 | 31 | Multiline: 32 | 33 | 37 | 38 | Code block: 39 | 40 | 41 | 42 | Just plain comment, with trailing spaces on the line: 43 | 44 | 45 | 46 | Code: 47 | 48 |
49 | 50 | Hr's: 51 | 52 |
53 | 54 |
55 | 56 |
57 | 58 |
59 | 60 |
61 | 62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/lazy_blockquotes.html: -------------------------------------------------------------------------------- 1 |
2 |

hi there 3 | bud

4 |
5 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/lazy_blockquotes.text: -------------------------------------------------------------------------------- 1 | > hi there 2 | bud 3 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/links.sanitize.html: -------------------------------------------------------------------------------- 1 |

2 |

3 |

4 |

-------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/links.sanitize.text: -------------------------------------------------------------------------------- 1 | [URL](javascript:alert) 2 | 3 | [URL](vbscript:alert) 4 | 5 | [URL](javascript:alert(1)) 6 | 7 | [URL](javascript:document;alert(1)) -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/links_inline_style.html: -------------------------------------------------------------------------------- 1 |

Just a URL.

2 | 3 |

URL and title.

4 | 5 |

URL and title.

6 | 7 |

URL and title.

8 | 9 |

URL and title.

10 | 11 |

URL and title.

12 | 13 |

URL and title.

14 | 15 |

Empty.

16 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/links_inline_style.text: -------------------------------------------------------------------------------- 1 | Just a [URL](/url/). 2 | 3 | [URL and title](/url/ "title"). 4 | 5 | [URL and title](/url/ "title preceded by two spaces"). 6 | 7 | [URL and title](/url/ "title preceded by a tab"). 8 | 9 | [URL and title](/url/ "title has spaces afterward" ). 10 | 11 | [URL and title]( /url/has space ). 12 | 13 | [URL and title]( /url/has space/ "url has space and title"). 14 | 15 | [Empty](). 16 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/links_reference_style.html: -------------------------------------------------------------------------------- 1 |

Foo bar.

2 | 3 |

Foo bar.

4 | 5 |

Foo bar.

6 | 7 |

With embedded [brackets].

8 | 9 |

Indented once.

10 | 11 |

Indented twice.

12 | 13 |

Indented thrice.

14 | 15 |

Indented [four][] times.

16 | 17 |
[four]: /url
18 | 
19 | 20 |
21 | 22 |

this should work

23 | 24 |

So should this.

25 | 26 |

And this.

27 | 28 |

And this.

29 | 30 |

And this.

31 | 32 |

But not [that] [].

33 | 34 |

Nor [that][].

35 | 36 |

Nor [that].

37 | 38 |

[Something in brackets sympathy this should work]

39 | 40 |

[Same with this.]

41 | 42 |

In this case, this points to something else.

43 | 44 |

Backslashing should suppress [this] and [this].

45 | 46 |
47 | 48 |

Here's one where the link 49 | breaks across lines.

50 | 51 |

Here's another where the link 52 | breaks across lines, but with a line-ending space.

53 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/links_reference_style.text: -------------------------------------------------------------------------------- 1 | Foo [bar] [1]. 2 | 3 | Foo [bar][1]. 4 | 5 | Foo [bar] 6 | [1]. 7 | 8 | [1]: /url/ "Title" 9 | 10 | 11 | With [embedded [brackets]] [b]. 12 | 13 | 14 | Indented [once][]. 15 | 16 | Indented [twice][]. 17 | 18 | Indented [thrice][]. 19 | 20 | Indented [four][] times. 21 | 22 | [once]: /url 23 | 24 | [twice]: /url 25 | 26 | [thrice]: /url 27 | 28 | [four]: /url 29 | 30 | 31 | [b]: /url/ 32 | 33 | * * * 34 | 35 | [this] [this] should work 36 | 37 | So should [this][this]. 38 | 39 | And [this] []. 40 | 41 | And [this][]. 42 | 43 | And [this]. 44 | 45 | But not [that] []. 46 | 47 | Nor [that][]. 48 | 49 | Nor [that]. 50 | 51 | [Something in brackets sympathy [this][] should work] 52 | 53 | [Same with [this].] 54 | 55 | In this case, [this](/somethingelse/) points to something else. 56 | 57 | Backslashing should suppress \[this] and [this\]. 58 | 59 | [this]: foo 60 | 61 | 62 | * * * 63 | 64 | Here's one where the [link 65 | breaks] across lines. 66 | 67 | Here's another where the [link 68 | breaks] across lines, but with a line-ending space. 69 | 70 | 71 | [link breaks]: /url/ 72 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/links_shortcut_references.html: -------------------------------------------------------------------------------- 1 |

This is the simple case.

2 | 3 |

This one has a line 4 | break.

5 | 6 |

This one has a line 7 | break with a line-ending space.

8 | 9 |

this and the other

10 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/links_shortcut_references.text: -------------------------------------------------------------------------------- 1 | This is the [simple case]. 2 | 3 | [simple case]: /simple 4 | 5 | 6 | 7 | This one has a [line 8 | break]. 9 | 10 | This one has a [line 11 | break] with a line-ending space. 12 | 13 | [line break]: /foo 14 | 15 | 16 | [this] [that] and the [other] 17 | 18 | [this]: /this 19 | [that]: /that 20 | [other]: /other 21 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/list_item_text.html: -------------------------------------------------------------------------------- 1 |
  • item1

    • item2

    text

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/list_item_text.text: -------------------------------------------------------------------------------- 1 | * item1 2 | 3 | * item2 4 | 5 | text 6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/literal_quotes_in_titles.html: -------------------------------------------------------------------------------- 1 |

Foo bar.

2 | 3 |

Foo bar.

4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/literal_quotes_in_titles.text: -------------------------------------------------------------------------------- 1 | Foo [bar][]. 2 | 3 | Foo [bar](/url/ "Title with "quotes" inside"). 4 | 5 | 6 | [bar]: /url/ "Title with "quotes" inside" 7 | 8 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/loose_lists.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • hello 3 | world

    4 | 5 |

    how 6 | are

  • 7 |
  • you
  • 8 |
9 | 10 | 11 | 12 |

better behavior:

13 | 14 |
  • hello

    • world 15 | how

      are 16 | you

    • today

  • hi
17 | 18 | 19 | 20 |
    21 |
  • hello

  • 22 |
  • world

  • 23 |
  • hi
  • 24 |
25 | 26 | 27 | 28 |
    29 |
  • hello
  • 30 |
  • world

  • 31 |
  • hi

  • 32 |
33 | 34 | 35 | 36 |
    37 |
  • hello
  • 38 |
  • world

    39 | 40 |

    how

  • 41 |
  • hi
  • 42 |
43 | 44 | 45 | 46 |
    47 |
  • hello
  • 48 |
  • world
  • 49 |
  • how

    50 | 51 |

    are

  • 52 |
53 | 54 | 55 | 56 |
    57 |
  • hello
  • 58 |
  • world

  • 59 |
  • how

    60 | 61 |

    are

  • 62 |
63 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/loose_lists.text: -------------------------------------------------------------------------------- 1 | * hello 2 | world 3 | 4 | how 5 | are 6 | * you 7 | 8 | 9 | 10 | better behavior: 11 | 12 | * hello 13 | * world 14 | how 15 | 16 | are 17 | you 18 | 19 | * today 20 | * hi 21 | 22 | 23 | 24 | * hello 25 | 26 | * world 27 | * hi 28 | 29 | 30 | 31 | * hello 32 | * world 33 | 34 | * hi 35 | 36 | 37 | 38 | * hello 39 | * world 40 | 41 | how 42 | * hi 43 | 44 | 45 | 46 | * hello 47 | * world 48 | * how 49 | 50 | are 51 | 52 | 53 | 54 | * hello 55 | * world 56 | 57 | * how 58 | 59 | are 60 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/main.html: -------------------------------------------------------------------------------- 1 |

A heading

Just a note, I've found that I can't test my markdown parser vs others. For example, both markdown.js and showdown code blocks in lists wrong. They're also completely inconsistent with regards to paragraphs in list items.

A link. Not anymore.

  • List Item 1

  • List Item 2

    • New List Item 1 Hi, this is a list item.
    • New List Item 2 Another item
      Code goes here.
      3 | Lots of it...
    • New List Item 3 The last item
  • List Item 3 The final item.

  • List Item 4 The real final item.

Paragraph.

  • bq Item 1
  • bq Item 2
    • New bq Item 1
    • New bq Item 2 Text here

Another blockquote! I really need to get more creative with mockup text.. markdown.js breaks here again

Another Heading

Hello world. Here is a link. And an image alt.

Code goes here.
4 | Lots of it...
5 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/main.text: -------------------------------------------------------------------------------- 1 | [test]: http://google.com/ "Google" 2 | 3 | # A heading 4 | 5 | Just a note, I've found that I can't test my markdown parser vs others. 6 | For example, both markdown.js and showdown code blocks in lists wrong. They're 7 | also completely [inconsistent][test] with regards to paragraphs in list items. 8 | 9 | A link. Not anymore. 10 | 11 | 13 | 14 | * List Item 1 15 | 16 | * List Item 2 17 | * New List Item 1 18 | Hi, this is a list item. 19 | * New List Item 2 20 | Another item 21 | Code goes here. 22 | Lots of it... 23 | * New List Item 3 24 | The last item 25 | 26 | * List Item 3 27 | The final item. 28 | 29 | * List Item 4 30 | The real final item. 31 | 32 | Paragraph. 33 | 34 | > * bq Item 1 35 | > * bq Item 2 36 | > * New bq Item 1 37 | > * New bq Item 2 38 | > Text here 39 | 40 | * * * 41 | 42 | > Another blockquote! 43 | > I really need to get 44 | > more creative with 45 | > mockup text.. 46 | > markdown.js breaks here again 47 | 48 | Another Heading 49 | ------------- 50 | 51 | Hello *world*. Here is a [link](//hello). 52 | And an image ![alt](src). 53 | 54 | Code goes here. 55 | Lots of it... 56 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/nested_blockquotes.html: -------------------------------------------------------------------------------- 1 |
2 |

foo

3 | 4 |
5 |

bar

6 |
7 | 8 |

foo

9 |
10 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/nested_blockquotes.text: -------------------------------------------------------------------------------- 1 | > foo 2 | > 3 | > > bar 4 | > 5 | > foo 6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/nested_code.html: -------------------------------------------------------------------------------- 1 |

hi ther `` ok ```

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/nested_code.text: -------------------------------------------------------------------------------- 1 | ````` hi ther `` ok ``` ````` 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/nested_em.html: -------------------------------------------------------------------------------- 1 |

test test test

2 | 3 |

test test test

4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/nested_em.text: -------------------------------------------------------------------------------- 1 | *test **test** test* 2 | 3 | _test __test__ test_ 4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/nested_square_link.html: -------------------------------------------------------------------------------- 1 |

the ] character

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/nested_square_link.text: -------------------------------------------------------------------------------- 1 | [the `]` character](/url) 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/not_a_link.html: -------------------------------------------------------------------------------- 1 |

[test](not a link)

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/not_a_link.text: -------------------------------------------------------------------------------- 1 | \[test](not a link) 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/ordered_and_unordered_lists.text: -------------------------------------------------------------------------------- 1 | ## Unordered 2 | 3 | Asterisks tight: 4 | 5 | * asterisk 1 6 | * asterisk 2 7 | * asterisk 3 8 | 9 | 10 | Asterisks loose: 11 | 12 | * asterisk 1 13 | 14 | * asterisk 2 15 | 16 | * asterisk 3 17 | 18 | * * * 19 | 20 | Pluses tight: 21 | 22 | + Plus 1 23 | + Plus 2 24 | + Plus 3 25 | 26 | 27 | Pluses loose: 28 | 29 | + Plus 1 30 | 31 | + Plus 2 32 | 33 | + Plus 3 34 | 35 | * * * 36 | 37 | 38 | Minuses tight: 39 | 40 | - Minus 1 41 | - Minus 2 42 | - Minus 3 43 | 44 | 45 | Minuses loose: 46 | 47 | - Minus 1 48 | 49 | - Minus 2 50 | 51 | - Minus 3 52 | 53 | 54 | ## Ordered 55 | 56 | Tight: 57 | 58 | 1. First 59 | 2. Second 60 | 3. Third 61 | 62 | and: 63 | 64 | 1. One 65 | 2. Two 66 | 3. Three 67 | 68 | 69 | Loose using tabs: 70 | 71 | 1. First 72 | 73 | 2. Second 74 | 75 | 3. Third 76 | 77 | and using spaces: 78 | 79 | 1. One 80 | 81 | 2. Two 82 | 83 | 3. Three 84 | 85 | Multiple paragraphs: 86 | 87 | 1. Item 1, graf one. 88 | 89 | Item 2. graf two. The quick brown fox jumped over the lazy dog's 90 | back. 91 | 92 | 2. Item 2. 93 | 94 | 3. Item 3. 95 | 96 | 97 | 98 | ## Nested 99 | 100 | * Tab 101 | * Tab 102 | * Tab 103 | 104 | Here's another: 105 | 106 | 1. First 107 | 2. Second: 108 | * Fee 109 | * Fie 110 | * Foe 111 | 3. Third 112 | 113 | Same thing but with paragraphs: 114 | 115 | 1. First 116 | 117 | 2. Second: 118 | * Fee 119 | * Fie 120 | * Foe 121 | 122 | 3. Third 123 | 124 | 125 | This was an error in Markdown 1.0.1: 126 | 127 | * this 128 | 129 | * sub 130 | 131 | that 132 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/ref_paren.html: -------------------------------------------------------------------------------- 1 |

hi

2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/ref_paren.text: -------------------------------------------------------------------------------- 1 | [hi] 2 | 3 | [hi]: /url (there) 4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/same_bullet.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • test
  • 3 |
  • test
  • 4 |
  • test
  • 5 |
6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/same_bullet.text: -------------------------------------------------------------------------------- 1 | * test 2 | + test 3 | - test 4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/strong_and_em_together.html: -------------------------------------------------------------------------------- 1 |

This is strong and em.

2 | 3 |

So is this word.

4 | 5 |

This is strong and em.

6 | 7 |

So is this word.

8 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/strong_and_em_together.text: -------------------------------------------------------------------------------- 1 | ***This is strong and em.*** 2 | 3 | So is ***this*** word. 4 | 5 | ___This is strong and em.___ 6 | 7 | So is ___this___ word. 8 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/tabs.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • this is a list item 3 | indented with tabs

  • 4 |
  • this is a list item 5 | indented with spaces

  • 6 |
7 | 8 |

Code:

9 | 10 |
this code block is indented by one tab
11 | 
12 | 13 |

And:

14 | 15 |
    this code block is indented by two tabs
16 | 
17 | 18 |

And:

19 | 20 |
+   this is an example list item
21 |     indented with tabs
22 | 
23 | +   this is an example list item
24 |     indented with spaces
25 | 
26 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/tabs.text: -------------------------------------------------------------------------------- 1 | + this is a list item 2 | indented with tabs 3 | 4 | + this is a list item 5 | indented with spaces 6 | 7 | Code: 8 | 9 | this code block is indented by one tab 10 | 11 | And: 12 | 13 | this code block is indented by two tabs 14 | 15 | And: 16 | 17 | + this is an example list item 18 | indented with tabs 19 | 20 | + this is an example list item 21 | indented with spaces 22 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/text.smartypants.html: -------------------------------------------------------------------------------- 1 |

Hello world ‘how’ “are” you – today…

2 | 3 |

“It’s a more ‘challenging’ smartypants test…”

4 | 5 |

‘And,’ as a bonus — “one 6 | multiline” test!

7 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/text.smartypants.text: -------------------------------------------------------------------------------- 1 | Hello world 'how' "are" you -- today... 2 | 3 | "It's a more 'challenging' smartypants test..." 4 | 5 | 'And,' as a bonus --- "one 6 | multiline" test! 7 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/tidyness.html: -------------------------------------------------------------------------------- 1 |
2 |

A list within a blockquote:

3 |
    4 |
  • asterisk 1
  • 5 |
  • asterisk 2
  • 6 |
  • asterisk 3
  • 7 |
8 |
9 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/tidyness.text: -------------------------------------------------------------------------------- 1 | > A list within a blockquote: 2 | > 3 | > * asterisk 1 4 | > * asterisk 2 5 | > * asterisk 3 6 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/toplevel_paragraphs.gfm.html: -------------------------------------------------------------------------------- 1 |

hello world 2 | how are you 3 | how are you

4 | 5 |

hello world

6 |
how are you
7 | 8 |

hello world

9 |
10 | 11 |

hello world

12 |

how are you

13 | 14 |

hello world

15 |

how are you

16 | 17 |

hello world

18 |

how are you

19 | 20 |

hello world

21 |
  • how are you
22 | 23 |

hello world

24 |
how are you
25 | 26 |

hello world 27 | how are you

28 | 29 |

hello world 30 |

31 | 32 |
hello
33 | 34 |

hello

35 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/toplevel_paragraphs.gfm.text: -------------------------------------------------------------------------------- 1 | hello world 2 | how are you 3 | how are you 4 | 5 | hello world 6 | ``` 7 | how are you 8 | ``` 9 | 10 | hello world 11 | * * * 12 | 13 | hello world 14 | # how are you 15 | 16 | hello world 17 | how are you 18 | =========== 19 | 20 | hello world 21 | > how are you 22 | 23 | hello world 24 | * how are you 25 | 26 | hello world 27 |
how are you
28 | 29 | hello world 30 | how are you 31 | 32 | hello [world][how] 33 | [how]: /are/you 34 | 35 |
hello
36 | 37 | hello 38 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/tricky_list.html: -------------------------------------------------------------------------------- 1 |

hello world

2 | 3 |
    4 |
  • hello world
  • 5 |
6 | 7 |

hello world

8 | 9 |
    10 |
  • hello world
  • 11 |
12 | 13 |

hello world

14 | 15 |
    16 |
  • Hello world
  • 17 |
18 | 19 |

hello world

20 | 21 |
    22 |
  • hello world
  • 23 |
24 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/marked-0.3.6/test/tests/tricky_list.text: -------------------------------------------------------------------------------- 1 | **hello** _world_ 2 | 3 | * hello world 4 | 5 | **hello** _world_ 6 | 7 | * hello world 8 | 9 | **hello** _world_ 10 | 11 | * Hello world 12 | 13 | **hello** _world_ 14 | 15 | * hello world 16 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/simditor-2.3.6/images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bvn13/SpringBlog/d3f35ea86c6859e583b86ee00259d8650c1a99e8/src/main/resources/resources/vendors/simditor-2.3.6/images/image.png -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/simditor-2.3.6/styles/simditor.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | @import 'fonticon'; 4 | @import 'editor'; 5 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/simditor-markdown/styles/simditor-markdown.css: -------------------------------------------------------------------------------- 1 | .simditor .markdown-editor { 2 | display: none; 3 | } 4 | .simditor .markdown-editor textarea { 5 | display: block; 6 | width: 100%; 7 | min-height: 200px; 8 | box-sizing: border-box; 9 | padding: 22px 15px 40px; 10 | border: none; 11 | border-bottom: 1px solid #dfdfdf; 12 | resize: none; 13 | outline: none; 14 | font-size: 16px; 15 | } 16 | .simditor.simditor-markdown .markdown-editor { 17 | display: block; 18 | } 19 | .simditor.simditor-markdown .simditor-body { 20 | min-height: 100px; 21 | background: #f3f3f3; 22 | } 23 | .simditor.simditor-markdown .simditor-placeholder { 24 | display: none !important; 25 | } 26 | .simditor .simditor-toolbar .toolbar-item.toolbar-item-markdown .simditor-icon { 27 | font-size: 18px; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/to-markdown-3.1.0/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components" 3 | } 4 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/to-markdown-3.1.0/.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | end_of_line = lf 8 | charset = utf-8 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | indent_style = space 12 | indent_size = 2 13 | max_line_length = 80 14 | 15 | [{*.md,*.json}] 16 | max_line_length = null 17 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/to-markdown-3.1.0/.gitignore: -------------------------------------------------------------------------------- 1 | bower_components/ 2 | node_modules/ 3 | bower_components/ 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/to-markdown-3.1.0/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 4 4 | 5 | before_script: 6 | - npm install -g bower 7 | - bower install --dev 8 | - npm install --dev 9 | 10 | script: 11 | - npm test 12 | - testem ci --port 8080 13 | 14 | env: 15 | global: 16 | - secure: gPidjA+ITMh8LixuPvvf/haZXOiM4eLbixFZupkeUo8jHgiBDBCoytzOvrXlBOWFx5QEByr7t4Q/UOHVVFM5/eRykN0RxO7JUiiosU49WFPB6uFiTEqmZx3Kb8L2bG8SITvCoRJSLVi1JS9dX5bQeeLA5HD/me+9ak4Ef4A0rlk= 17 | - secure: PnHNOs9Ld/kO4qXhjxtE04j/zC0rgPMev5FpbTQ7gEqDGn1PBTfKWLAcbUpPkMO9hKADJvBCWU8+VCmPZ0Qk6nu6KKAAkvE5acpwM3yeLckgzVxeAncxS9mvGSTNRv9EHbxIN9g8Jo1FtN0UhY9Y23xq8MxyDC0ManeLin7Q6qs= 18 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/to-markdown-3.1.0/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2015 Dom Christie 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/to-markdown-3.1.0/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "to-markdown", 3 | "homepage": "https://github.com/domchristie/to-markdown", 4 | "authors": [ 5 | "Dom Christie " 6 | ], 7 | "description": "An HTML to Markdown converter written in JavaScript", 8 | "main": "dist/to-markdown.js", 9 | "keywords": [ 10 | "markdown", 11 | "html" 12 | ], 13 | "license": "MIT", 14 | "ignore": [ 15 | "**/.*", 16 | "node_modules", 17 | "bower_components", 18 | "package.json", 19 | "test", 20 | "lib", 21 | "index.js" 22 | ], 23 | "devDependencies": { 24 | "qunit": "~1.14.0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/to-markdown-3.1.0/lib/html-parser.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Set up window for Node.js 3 | */ 4 | 5 | var _window = (typeof window !== 'undefined' ? window : this) 6 | 7 | /* 8 | * Parsing HTML strings 9 | */ 10 | 11 | function canParseHtmlNatively () { 12 | var Parser = _window.DOMParser 13 | var canParse = false 14 | 15 | // Adapted from https://gist.github.com/1129031 16 | // Firefox/Opera/IE throw errors on unsupported types 17 | try { 18 | // WebKit returns null on unsupported types 19 | if (new Parser().parseFromString('', 'text/html')) { 20 | canParse = true 21 | } 22 | } catch (e) {} 23 | 24 | return canParse 25 | } 26 | 27 | function createHtmlParser () { 28 | var Parser = function () {} 29 | 30 | // For Node.js environments 31 | if (typeof document === 'undefined') { 32 | var jsdom = require('jsdom') 33 | Parser.prototype.parseFromString = function (string) { 34 | return jsdom.jsdom(string, { 35 | features: { 36 | FetchExternalResources: [], 37 | ProcessExternalResources: false 38 | } 39 | }) 40 | } 41 | } else { 42 | if (!shouldUseActiveX()) { 43 | Parser.prototype.parseFromString = function (string) { 44 | var doc = document.implementation.createHTMLDocument('') 45 | doc.open() 46 | doc.write(string) 47 | doc.close() 48 | return doc 49 | } 50 | } else { 51 | Parser.prototype.parseFromString = function (string) { 52 | var doc = new window.ActiveXObject('htmlfile') 53 | doc.designMode = 'on' // disable on-page scripts 54 | doc.open() 55 | doc.write(string) 56 | doc.close() 57 | return doc 58 | } 59 | } 60 | } 61 | return Parser 62 | } 63 | 64 | function shouldUseActiveX () { 65 | var useActiveX = false 66 | 67 | try { 68 | document.implementation.createHTMLDocument('').open() 69 | } catch (e) { 70 | if (window.ActiveXObject) useActiveX = true 71 | } 72 | 73 | return useActiveX 74 | } 75 | 76 | module.exports = canParseHtmlNatively() ? _window.DOMParser : createHtmlParser() 77 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/to-markdown-3.1.0/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "to-markdown", 3 | "description": "HTML-to-Markdown converter", 4 | "version": "3.1.0", 5 | "author": "Dom Christie", 6 | "browser": { 7 | "jsdom": false 8 | }, 9 | "dependencies": { 10 | "collapse-whitespace": "1.1.2", 11 | "jsdom": "^9.0.0" 12 | }, 13 | "devDependencies": { 14 | "qunit": "^0.7.6", 15 | "saucie": "0.1.3", 16 | "standard": "^6.0.8", 17 | "testem": "^0.8.2", 18 | "watchify": "^2.5.0" 19 | }, 20 | "engines": { 21 | "node": ">=4.0.0" 22 | }, 23 | "keywords": [ 24 | "markdown" 25 | ], 26 | "license": "MIT", 27 | "main": "index.js", 28 | "repository": { 29 | "type": "git", 30 | "url": "https://github.com/domchristie/to-markdown.git" 31 | }, 32 | "scripts": { 33 | "start": "watchify -s toMarkdown -o dist/to-markdown.js index.js -v", 34 | "test": "standard index.js lib/**/*.js test/**/*.js && qunit -c ./index.js -t ./test/to-markdown-test.js ./test/gfm-test.js" 35 | }, 36 | "url": "http://domchristie.github.com/to-markdown/" 37 | } 38 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/to-markdown-3.1.0/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QUnit Example 6 | 7 | 8 | 9 |
10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/to-markdown-3.1.0/testem.yml: -------------------------------------------------------------------------------- 1 | framework: qunit 2 | 3 | src_files: [dist/to-markdown.js, test/to-markdown-test.js] 4 | 5 | launchers: 6 | sl_ff_mac: 7 | command: saucie --browserNameSL="firefox" --platformSL="OS X 10.10" 8 | protocol: tap 9 | 10 | sl_chrome_mac: 11 | command: saucie --browserNameSL="chrome" --platformSL="OS X 10.10" 12 | protocol: tap 13 | 14 | sl_safari_mac: 15 | command: saucie --browserNameSL="safari" --platformSL="OS X 10.10" 16 | protocol: tap 17 | 18 | sl_ff_win: 19 | command: saucie --browserNameSL="firefox" --platformSL="Windows 8.1" 20 | protocol: tap 21 | 22 | sl_chrome_win: 23 | command: saucie --browserNameSL="chrome" --platformSL="Windows 8.1" 24 | protocol: tap 25 | 26 | sl_ie_11: 27 | command: saucie --browserNameSL="internet explorer" --versionSL="11" --platformSL="Windows 8.1" 28 | protocol: tap 29 | 30 | sl_ie_10: 31 | command: saucie --browserNameSL="internet explorer" --versionSL="10" --platformSL="Windows 8" 32 | protocol: tap 33 | 34 | sl_ie_9: 35 | command: saucie --browserNameSL="internet explorer" --versionSL="9" --platformSL="Windows 7" 36 | protocol: tap 37 | 38 | launch_in_ci: [sl_ff_mac, sl_chrome_mac, sl_safari_mac, sl_ff_win, sl_chrome_win, sl_ie_9, sl_ie_10, sl_ie_11] 39 | launch_in_dev: [Chrome, Firefox, Safari, Opera] 40 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/typo.css-2.1.2/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/typo.css-2.1.2/README.md: -------------------------------------------------------------------------------- 1 | ## 中文网页重设与排版: 2 | 3 | 目标:一致化浏览器排版效果,构建最适合中文阅读的网页排版。包括桌面和移动平台。 4 | 5 | 预览:[typo.css](http://typo.sofi.sh) 6 | 7 | ### 一、目录结构 8 | . 9 | ├── README.md --- 使用帮助 10 | ├── license.txt --- 许可证 11 | ├── typo.css --- 将应用于你的项目 12 | └── typo.html --- Demo/预览 13 | 14 | 15 | ### 二、TYPO.CSS 的设计和使用 16 | 17 | 18 | ## TYPO.CSS 主要包括: 19 | 20 | 1、一般 reset.css 所需的内容 21 | 22 | 目前的设计是这样的,尽量保持完整的 reset,比如让 ul/ol 无样式并且无多余的 `padding`/`margin`,这是必须的,因为一个网可能需要很多自定义的的内容,在实践中我们并不希望像 ul/ol 有样式,这样我们得用优先级去覆盖,这是非常麻烦的事。所以 typo.css 并不像 normalize.css,后者给每一个元素都预先定义了样式,这样在自定义的时候将是非常痛苦的。要大保持干净的所有元素一致化的 reset 才是最佳实践。 23 | 24 | 2、`class="typo"` 阅读内容排版 25 | 26 | 在文章/文档阅读的页面,需添加 `.typo` 这个 class,这样 table/ol/ul 等都会有预定的样式,让你的排版像 [http://typo.sofi.sh](http://typo.sofi.sh) 一样,让用户阅读起来更舒服。 27 | 28 | 在父容器在没有添加 `class="typo"` 的时候,可以使用 `class="typo-标签"`(如 `class="typo-ul"`)来实现像 `.typo > ul` 这样结构的样式。 29 | 30 | 3、增加类: 31 | 32 | 主要是一些需要中文日常排版需要的元素和语文对应样式的增强,目前包括: 33 | 34 | (1) 专名号:使用标签 `` 或者 `.typo-u`
35 | (2) 着重号:使用 class `.typo-em`
36 | (3) 清理浮动:与一般 reset.css 保持一致 `.clearfix`
37 | (4) 强制换行:添加 `.textwrap` 到文本所在的容器,如果是 `table` 测还需要 `.textwrap-table`
38 | (5) 衬线字体:添加 `.serif`
39 | (6) 创建 border-box:在 html 中添加 `.borderbox` [#why](http://www.paulirish.com/2012/box-sizing-border-box-ftw/) 40 | 41 | 42 | ### 三、开源许可 43 | 基于 [MIT License](http://zh.wikipedia.org/wiki/MIT_License) 开源,使用代码只需说明来源,或者引用 [license.txt](https://github.com/sofish/typo.css/blob/master/license.txt) 即可。 44 | -------------------------------------------------------------------------------- /src/main/resources/resources/vendors/typo.css-2.1.2/license.txt: -------------------------------------------------------------------------------- 1 | TYPO.CSS - a better way to manage the typography of your Chinese-lang-base site. 2 | 3 | Copyright (C) 2012 Sofish Lin http://sofish.de 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bvn13/SpringBlog/d3f35ea86c6859e583b86ee00259d8650c1a99e8/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /src/main/resources/static/robots.txt: -------------------------------------------------------------------------------- 1 | # Указывает директивы для всех роботов одновременно 2 | User-agent: * 3 | Disallow: /admin 4 | Disallow: /admin/* 5 | Disallow: /signin 6 | Host: https://bvn13.tk 7 | -------------------------------------------------------------------------------- /src/main/resources/templates/admin/files/edit.jade: -------------------------------------------------------------------------------- 1 | extends ../layout/admin 2 | 3 | 4 | block content 5 | h1 Edit stored file information 6 | hr 7 | 8 | 9 | form.post-form(method="post",action="/admin/files/#{file.getId()}") 10 | .item-row 11 | input(type="hidden", name='_csrf', value='#{_csrf.token}') 12 | .item-row 13 | input(type="hidden", name="path", value='#{fileForm.getPath()}') 14 | .item-row 15 | input(type="hidden", name="size", value="#{fileForm.getSize()}") 16 | 17 | .item-row 18 | | Title 19 | input.form-control(type="text", name="title", value='#{fileForm.getTitle()}') 20 | .item-row 21 | | Name 22 | input.form-control(type="text", name="name", value='#{fileForm.getName()}') 23 | .item-row 24 | | Path 25 | input.form-control(type="text", value='#{fileForm.getPath()}', disabled="true") 26 | .item-row 27 | | Size 28 | input.form-control(type="text", value="#{fileForm.getSize()}", disabled="true") 29 | 30 | .item-row 31 | hr 32 | button.btn.btn-primary.btn-block(type="submit") Save 33 | -------------------------------------------------------------------------------- /src/main/resources/templates/admin/files/fragments/fileUploadForm.jade: -------------------------------------------------------------------------------- 1 | 2 | form.post-form(method='POST', action='/admin/files/upload', enctype="multipart/form-data") 3 | input(type="hidden", name='_csrf', value='#{_csrf.token}') 4 | .item-row 5 | input.form-control(type='file', name="file") 6 | .item-row 7 | input.btn.btn-primary(type='submit', value='Upload') -------------------------------------------------------------------------------- /src/main/resources/templates/admin/files/fragments/list.jade: -------------------------------------------------------------------------------- 1 | 2 | 3 | .row 4 | include paginator 5 | 6 | .row(style="margin-top: 10px;") 7 | .col-sm-12 8 | table.table.table-bordered.table-hover.table-stripped 9 | thead 10 | tr 11 | th ID 12 | th Title 13 | th Name 14 | th Size 15 | th Created at 16 | th Updated at 17 | th Operations 18 | 19 | tbody 20 | for file in files 21 | tr 22 | td #{file.getId()} 23 | td #{file.getTitle()} 24 | td #{file.getName()} 25 | td #{file.getSizeFormatted()} 26 | td #{file.getCreatedAt()} 27 | td #{file.getUpdatedAt()} 28 | td.operations 29 | a.btn.btn-xs.btn-primary(href="/admin/files/#{file.getId()}/edit") 30 | i.fa.fa-edit 31 | a.btn.btn-xs.btn-danger.btn-delete(href="javascript:deleteFile(#{file.getId()})", fileId="#{file.getId()}") 32 | i.fa.fa-trash-o 33 | 34 | form(id="form-file-#{file.getId()}",style="visibility: hidden", method="post", action="/admin/files/#{file.getId()}/delete") 35 | input(type="hidden", name='_csrf', value='#{_csrf.token}') 36 | 37 | 38 | .row 39 | include paginator 40 | 41 | 42 | script 43 | :javascript 44 | function deleteFile(fileId){ 45 | if (confirm("Are you sure to delete file @"+fileId)) { 46 | $('#form-file-'+fileId).submit(); 47 | } 48 | } -------------------------------------------------------------------------------- /src/main/resources/templates/admin/files/fragments/paginator.jade: -------------------------------------------------------------------------------- 1 | 2 | .load-more 3 | nav 4 | ul.pagination 5 | if page >= 1 6 | li.previous 7 | a.btn(href="?page=#{page - 1}") 8 | span(aria-hidden="true") ← 9 | | Newer files 10 | 11 | for pageNum in pagesList 12 | if pageNum==page 13 | li.active 14 | a.btn(href="?page=#{pageNum}") 15 | = pageNum+1 16 | else 17 | li 18 | a.btn(href="?page=#{pageNum}") 19 | = pageNum+1 20 | 21 | 22 | if totalPages-1 > page 23 | li.next 24 | a.btn(href="?page=#{page + 1}") 25 | | Older files 26 | span(aria-hidden="true") → 27 | -------------------------------------------------------------------------------- /src/main/resources/templates/admin/files/index.jade: -------------------------------------------------------------------------------- 1 | extends ../layout/admin 2 | 3 | block content 4 | h1 Uploads 5 | hr 6 | 7 | include fragments/fileUploadForm 8 | 9 | hr 10 | 11 | include fragments/list 12 | -------------------------------------------------------------------------------- /src/main/resources/templates/admin/files/status.jade: -------------------------------------------------------------------------------- 1 | extends ../layout/admin 2 | 3 | block content 4 | h1 Upload status 5 | hr 6 | 7 | 8 | div 9 | if uploadStatus == null || uploadStatus.isEmpty() 10 | | Nothing is received 11 | else 12 | = uploadStatus 13 | 14 | br 15 | 16 | div 17 | a.btn.btn-default(href="/admin/files") Back -------------------------------------------------------------------------------- /src/main/resources/templates/admin/home/settings.jade: -------------------------------------------------------------------------------- 1 | extends ../layout/admin 2 | 3 | block content 4 | h1 Settings 5 | hr 6 | 7 | form.settings-form(method="post",action="/admin/settings") 8 | input(type="hidden", name='_csrf', value='#{_csrf.token}') 9 | table.table.table-hover.table-bordered.settings 10 | tbody 11 | tr 12 | td.setting-label Site Name 13 | td.input 14 | input.form-control(type="text", name="siteName", value="#{settings.getSiteName()}") 15 | 16 | tr 17 | td.setting-label Site Slogan 18 | td.input 19 | input.form-control(type="text", name="siteSlogan", value="#{settings.getSiteSlogan()}") 20 | tr 21 | td.setting-label Page Size 22 | td.input 23 | input.form-control(type="text", name="pageSize", value="#{settings.getPageSize()}") 24 | tr 25 | td.setting-label Storage path 26 | td.input 27 | input.form-control(type="text", name="storagePath", value="#{settings.getStoragePath()}") 28 | tr 29 | td.setting-label Main URI 30 | td.input 31 | input.form-control(type="text", name="mainUri", value="#{settings.getMainUri()}") 32 | tr 33 | td.setting-label Telegram master chat ID 34 | td.input 35 | input.form-control(type="text", name="telegramMasterChatId", value="#{settings.getTelegramMasterChatId()}") 36 | tr 37 | td.setting-label Subscription link 38 | td.input 39 | input.form-control(type="text", name="subscriptionLink", value="#{settings.getSubscriptionLink()}") 40 | 41 | tr 42 | td.setting-label 43 | td.input 44 | input.btn.btn-primary(type="submit", value="Save") 45 | 46 | -------------------------------------------------------------------------------- /src/main/resources/templates/admin/layout/admin.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang="en") 3 | head 4 | include head 5 | block head 6 | 7 | body 8 | include navbar 9 | .container.main-container 10 | include message 11 | block content 12 | -------------------------------------------------------------------------------- /src/main/resources/templates/admin/layout/footer.jade: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bvn13/SpringBlog/d3f35ea86c6859e583b86ee00259d8650c1a99e8/src/main/resources/templates/admin/layout/footer.jade -------------------------------------------------------------------------------- /src/main/resources/templates/admin/layout/head.jade: -------------------------------------------------------------------------------- 1 | meta(charset="utf-8") 2 | meta(http-equiv="X-UA-Compatible", content="IE=edge") 3 | meta(name="viewport", content="width=device-width, initial-scale=1") 4 | 5 | meta(name="description", content="#{App.getSiteSlogan()}") 6 | meta(name="author", content="bvn13") 7 | 8 | link(rel="shortcut icon", href="/favicon.ico", type="image/x-icon") 9 | link(rel="icon", href="/favicon.ico", type="image/x-icon") 10 | 11 | title #{App.getSiteName()} 12 | 13 | link(rel='stylesheet', type='text/css', href='/webjars/bootstrap/3.3.7-1/css/bootstrap.min.css') 14 | link(rel='stylesheet', type='text/css', href='/webjars/font-awesome/4.7.0/css/font-awesome.min.css') 15 | link(rel="stylesheet", type='text/css', href="/css/admin/admin.css") 16 | //link(rel="stylesheet", href="/vendors/simditor-2.3.6/styles/simditor.css") 17 | //link(rel="stylesheet", href="/vendors/simditor-markdown/styles/simditor-markdown.css") 18 | 19 | script(src="/webjars/jquery/3.2.1/jquery.min.js") 20 | script(src="/webjars/bootstrap/3.3.7-1/js/bootstrap.min.js") 21 | script(src="/vendors/bootstrap-paginator-1.0.2/js/bootstrap-paginator.min.js") 22 | script(src="/vendors/marked-0.3.6/marked.min.js") 23 | script(src="/vendors/to-markdown-3.1.0/dist/to-markdown.js") 24 | 25 | //script(src="/vendors/simditor-2.3.6/scripts/module.js") 26 | //script(src="/vendors/simditor-2.3.6/scripts/hotkeys.js") 27 | //script(src="/vendors/simditor-2.3.6/scripts/uploader.js") 28 | 29 | //script(src="/vendors/simditor-2.3.6/scripts/simditor.js") 30 | //script(src="/vendors/simditor-markdown/lib/simditor-markdown.js") 31 | 32 | script(src="https://code.highcharts.com/highcharts.js") 33 | script(src="https://code.highcharts.com/modules/exporting.js") 34 | 35 | script(src="//cdn.jsdelivr.net/momentjs/latest/moment.min.js") 36 | script(src="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.js") 37 | link(rel="stylesheet", type="text/css", href="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.css") -------------------------------------------------------------------------------- /src/main/resources/templates/admin/layout/message.jade: -------------------------------------------------------------------------------- 1 | if message != null 2 | 3 | .alert.alert-info 4 | = message.getMessage() 5 | -------------------------------------------------------------------------------- /src/main/resources/templates/admin/layout/navbar.jade: -------------------------------------------------------------------------------- 1 | nav.navbar.navbar-fixed-top.navbar-default 2 | .container 3 | .navbar-header 4 | button.navbar-toggle.collapsed(type="button", data-toggle="collapse", data-target="#navbar", aria-expanded="false", aria-controls="navbar") 5 | span.sr-only Toggle navigation 6 | span.icon-bar 7 | span.icon-bar 8 | span.icon-bar 9 | a.navbar-brand(href="/admin") 10 | span #{App.getSiteName()} 11 | .collapse.navbar-collapse#navbar 12 | ul.nav.navbar-nav 13 | li: a(href="/admin/posts") Posts 14 | li: a(href="/admin/files") Files 15 | li: a(href="/admin/robotsAgents") Robots Agents 16 | li: a(href="/admin/settings") Settings 17 | li: a(href="/admin/users/profile") Profile 18 | li: a(href="/") Site Home 19 | 20 | ul.nav.navbar-nav.navbar-right.navbar-user 21 | li 22 | a(href="javascript:$('#form').submit();") Logout 23 | 24 | form#form(style="visibility: hidden", method="post", action="/logout") 25 | input(type="hidden", name='_csrf', value='#{_csrf.token}') 26 | 27 | -------------------------------------------------------------------------------- /src/main/resources/templates/admin/posts/fragments/paginator.jade: -------------------------------------------------------------------------------- 1 | 2 | .load-more 3 | nav 4 | ul.pagination 5 | if page >= 1 6 | li.previous 7 | a.btn(href="?page=#{page - 1}") 8 | span(aria-hidden="true") ← 9 | | Newer posts 10 | 11 | for pageNum in pagesList 12 | if pageNum==page 13 | li.active 14 | a.btn(href="?page=#{pageNum}") 15 | = pageNum+1 16 | else 17 | li 18 | a.btn(href="?page=#{pageNum}") 19 | = pageNum+1 20 | 21 | 22 | if totalPages-1 > page 23 | li.next 24 | a.btn(href="?page=#{page + 1}") 25 | | Older posts 26 | span(aria-hidden="true") → 27 | -------------------------------------------------------------------------------- /src/main/resources/templates/admin/robotsAgents/edit.jade: -------------------------------------------------------------------------------- 1 | extends ../layout/admin 2 | 3 | block content 4 | h1 Robots' User-Agent creation 5 | hr 6 | 7 | include fragments/seoRobotAgentForm -------------------------------------------------------------------------------- /src/main/resources/templates/admin/robotsAgents/fragments/seoRobotAgentForm.jade: -------------------------------------------------------------------------------- 1 | 2 | 3 | form.post-form(method='POST', action='/admin/robotsAgents/#{form.getId()}/edit') 4 | input(type="hidden", name='_csrf', value='#{_csrf.token}') 5 | input(type="hidden", name="id", value="#{form.getId()}") 6 | .item-row 7 | | User-Agent: 8 | input.form-control(name="userAgent", value="#{form.getUserAgent()}") 9 | .item-row 10 | label 11 | | Is RegExp: 12 | input(name="isRegexp", type="hidden", value="#{form.getIsRegexp() == true ? 'true' : 'false'}") 13 | input(id="isRegexp", type="checkbox") 14 | .item-row 15 | input.btn.btn-primary(type='submit', value='Save') 16 | 17 | 18 | script 19 | :javascript 20 | $(document).ready(function() { 21 | 22 | var isChecked = $("input[name=isRegexp]").val(); 23 | if (isChecked === 'true') { 24 | $("input#isRegexp").attr('checked', 'checked'); 25 | } else { 26 | $("input#isRegexp").removeAttr('checked'); 27 | } 28 | 29 | $("input#isRegexp").click(function(){ 30 | $("input[name=isRegexp]").val(""+$(this).is(':checked')); 31 | }); 32 | 33 | }); -------------------------------------------------------------------------------- /src/main/resources/templates/admin/robotsAgents/index.jade: -------------------------------------------------------------------------------- 1 | extends ../layout/admin 2 | 3 | block content 4 | h1 Robots' User-Agent list 5 | hr 6 | 7 | include fragments/seoRobotAgentForm 8 | 9 | hr 10 | 11 | .row(style="margin-top: 10px;") 12 | .col-sm-12 13 | table.table.table-bordered.table-hover.table-stripped 14 | thead 15 | tr 16 | th ID 17 | th User-Agent 18 | th Is Regexp 19 | th Operations 20 | 21 | tbody 22 | for record in records 23 | tr 24 | td #{record.getId()} 25 | td #{record.getUserAgent()} 26 | td #{record.getIsRegexp().toString()} 27 | td.operations 28 | a.btn.btn-xs.btn-primary(href="/admin/robotsAgents/#{record.getId()}/edit") 29 | i.fa.fa-edit 30 | a.btn.btn-xs.btn-danger.btn-delete(href="javascript:deleteRobotAgent(#{record.getId()})", fileId="#{record.getId()}") 31 | i.fa.fa-trash-o 32 | 33 | form(id="form-robotAgent-#{record.getId()}",style="visibility: hidden", method="post", action="/admin/robotsAgents/#{record.getId()}/delete") 34 | input(type="hidden", name='_csrf', value='#{_csrf.token}') 35 | 36 | 37 | 38 | 39 | script 40 | :javascript 41 | function deleteRobotAgent(recordId) { 42 | if (confirm("Are you sure to delete RobotAgent @" + recordId)) { 43 | $('#form-robotAgent-' + recordId).submit(); 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/resources/templates/admin/users/profile.jade: -------------------------------------------------------------------------------- 1 | extends ../layout/admin 2 | 3 | block content 4 | h1 Profile 5 | hr 6 | 7 | .profile 8 | form.post-form(method="post", action="/admin/users/#{user.getId()}") 9 | input(type="hidden", name='_csrf', value='#{_csrf.token}') 10 | 11 | .row 12 | .col-sm-2 ID 13 | .col-sm-3 #{user.getId()} 14 | 15 | hr 16 | .row 17 | .col-sm-2 Email 18 | .col-sm-3 #{user.getEmail()} 19 | 20 | hr 21 | .row 22 | .col-sm-2 Created Time 23 | .col-sm-3 #{user.getCreatedAt()} 24 | 25 | hr 26 | .row 27 | .col-sm-2 Password 28 | .col-sm-3 29 | input.form-control(type="password", name="password") 30 | 31 | hr 32 | .row 33 | .col-sm-2 New Password 34 | .col-sm-3 35 | input.form-control(type="password", name="newPassword") 36 | 37 | hr 38 | .row 39 | .col-sm-2 40 | .col-sm-3 41 | input.btn.btn-primary(type="submit", value="Save profile") 42 | 43 | hr 44 | -------------------------------------------------------------------------------- /src/main/resources/templates/error.jade: -------------------------------------------------------------------------------- 1 | include error/general -------------------------------------------------------------------------------- /src/main/resources/templates/error/general.jade: -------------------------------------------------------------------------------- 1 | extends ../layout/app 2 | 3 | block title 4 | #{status} #{error} 5 | 6 | block page_title 7 | h1 #{status} #{error} 8 | 9 | p Request page: #{path} 10 | 11 | p #{customMessage} 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/templates/fragments/disqus.jade: -------------------------------------------------------------------------------- 1 | div#disqus_thread 2 | 3 | script 4 | :javascript 5 | /* * * CONFIGURATION VARIABLES * * */ 6 | var disqus_shortname = 'bvn13s-blog'; 7 | 8 | /* * * DON'T EDIT BELOW THIS LINE * * */ 9 | (function() { 10 | var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; 11 | dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; 12 | (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); 13 | })(); 14 | 15 | noscript 16 | |Please enable JavaScript to view the 17 | a(href="https://disqus.com/?ref_noscript", rel="nofollow") comments powered by Disqus 18 | -------------------------------------------------------------------------------- /src/main/resources/templates/fragments/ga.jade: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/main/resources/templates/fragments/ya-metrics.jade: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bvn13/SpringBlog/d3f35ea86c6859e583b86ee00259d8650c1a99e8/src/main/resources/templates/fragments/ya-metrics.jade -------------------------------------------------------------------------------- /src/main/resources/templates/home/about.jade: -------------------------------------------------------------------------------- 1 | extends ../layout/app 2 | 3 | block page_title 4 | h1 #{App.getSiteName()} 5 | p Something about me. 6 | 7 | block title 8 | = viewHelper.metaTitle("About " + App.getSiteName()) 9 | 10 | block content 11 | .post 12 | .content 13 | !{about.getRenderedContent()} 14 | 15 | .comments 16 | include ../fragments/disqus 17 | -------------------------------------------------------------------------------- /src/main/resources/templates/home/index.jade: -------------------------------------------------------------------------------- 1 | extends ../layout/app 2 | 3 | block page_title 4 | // .avatar 5 | // img(src="/images/user.jpg") 6 | h1 #{App.getSiteName()} 7 | p.meta #{App.getSiteSlogan()} 8 | 9 | block title 10 | = App.getSiteName() 11 | 12 | block content 13 | include ../posts/index 14 | 15 | .ads 16 | !{Ads.getYandexMainPageCode()} 17 | 18 | .loadmore 19 | a.btn.btn-default(href="/posts/archive") More 20 | -------------------------------------------------------------------------------- /src/main/resources/templates/layout/app.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang="en") 3 | head 4 | include head 5 | block head 6 | 7 | body.typo 8 | include navbar 9 | 10 | include top 11 | 12 | .container.main-container 13 | block content 14 | 15 | include footer 16 | 17 | if viewHelper.isProductionMode() 18 | include ../fragments/ga 19 | include ../fragments/ya-metrics 20 | -------------------------------------------------------------------------------- /src/main/resources/templates/layout/footer.jade: -------------------------------------------------------------------------------- 1 | .container 2 | .footer 3 | .footer-wrapper 4 | hr 5 | p 6 | | © · 2017 — #{viewHelper.currentYear()} ·   7 | a(href="http://bvn13.tk") bvn13 8 | | · 9 | 10 | if viewHelper != null 11 | span #{viewHelper.getResponseTime()}ms 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/templates/layout/navbar.jade: -------------------------------------------------------------------------------- 1 | nav.navbar.navbar-bright 2 | .container 3 | .navbar-header 4 | a.navbar-brand(href="/") #{App.getSiteName()} 5 | div#navbar 6 | ul.nav.navbar-nav.navbar-right 7 | if App.getSubscriptionLink() != null && !App.getSubscriptionLink().isEmpty() 8 | li: a(href="#{App.getSubscriptionLink()}" target="_blank") 9 | span(style="color: #a94442") Subscribe 10 | li: a(href="/posts/archive") Blog 11 | li: a(href="/tags") Tags 12 | li: a(href="/posts/projects") Projects 13 | li: a(href="/about") About 14 | if userService.currentUser() != null && userService.currentUser().isAdmin() 15 | li: a(href="/admin") Admin 16 | -------------------------------------------------------------------------------- /src/main/resources/templates/layout/top.jade: -------------------------------------------------------------------------------- 1 | .container 2 | .header-title 3 | .header-title-wrapper 4 | block page_title 5 | -------------------------------------------------------------------------------- /src/main/resources/templates/posts/archive.jade: -------------------------------------------------------------------------------- 1 | extends ../layout/app 2 | 3 | block page_title 4 | h1 Posts Archive 5 | p Look back and find something interesting. 6 | 7 | block title 8 | = viewHelper.metaTitle("Posts Archive") 9 | 10 | block content 11 | .post 12 | .content 13 | .year 14 | //h2 2015 15 | ul.archive-list 16 | for post in posts 17 | 18 | li 19 | span.month 20 | = viewHelper.getMonthAndDay(post.getCreatedAt()) 21 | span   ·  22 | a(href="/posts/#{post.getPermalink().length() > 0 ? post.getPermalink() : post.getId()}") 23 | = post.getTitle() 24 | 25 | -------------------------------------------------------------------------------- /src/main/resources/templates/posts/fragments/paginator.jade: -------------------------------------------------------------------------------- 1 | 2 | 3 | .load-more 4 | nav 5 | ul.pager 6 | 7 | if page > 1 8 | li.previous 9 | a.btn(href="?page=#{page - 1}") 10 | span(aria-hidden="true") ← 11 | | Newer posts 12 | 13 | 14 | if totalPages > page 15 | li.next 16 | a.btn(href="?page=#{page + 1}") 17 | | Older posts 18 | span(aria-hidden="true") → 19 | 20 | -------------------------------------------------------------------------------- /src/main/resources/templates/posts/fragments/social.jade: -------------------------------------------------------------------------------- 1 | 2 | div 3 | 4 | input#postId(type="hidden", value="#{post.getId()}") 5 | input(type="hidden", name="_csrf" value="#{_csrf.token}") 6 | 7 | span.sympathy-block 8 | span.sympathy #{viewHelper.formatNumberByThousands(post.getVisitsCount())} 9 | img.borderless(src="/images/open-eye-with-blank-pupil.png") 10 | 11 | span.sympathy-block 12 | img#like.borderless.sympathy-button(src="/images/like.png") 13 | span#sympathy.sympathy #{viewHelper.formatNumberByThousands(post.getSympathyCount())} 14 | img#dislike.borderless.sympathy-button(src="/images/dislike.png") 15 | 16 | 17 | script 18 | :javascript 19 | var token = $("input[name='_csrf']").val(); 20 | var header = "X-CSRF-TOKEN"; 21 | $(document).ajaxSend(function (e, xhr, options) { 22 | xhr.setRequestHeader(header, token); 23 | }); 24 | $("#like").click(function() { 25 | var postId = $("#postId").val(); 26 | $.ajax({ 27 | url : "/sympathy/like", 28 | type: "POST", 29 | contentType: "application/json", 30 | data: JSON.stringify({ 31 | postId: postId 32 | }) 33 | }).done(function(data) { 34 | $("#sympathy").text(data.sympathy); 35 | }); 36 | }); 37 | $("#dislike").click(function () { 38 | var postId = $("#postId").val(); 39 | $.ajax({ 40 | url: "/sympathy/dislike", 41 | type: "POST", 42 | contentType: "application/json", 43 | data: JSON.stringify({ 44 | postId: postId 45 | }) 46 | }).done(function (data) { 47 | $("#sympathy").text(data.sympathy); 48 | }); 49 | }); -------------------------------------------------------------------------------- /src/main/resources/templates/posts/fragments/socialReadonly.jade: -------------------------------------------------------------------------------- 1 | div 2 | span.sympathy-block 3 | span.sympathy #{viewHelper.formatNumberByThousands(post.getVisitsCount())} 4 | img.borderless(src="/images/open-eye-with-blank-pupil_min.png") 5 | span.sympathy-block 6 | img.borderless(src="/images/like_min.png") 7 | span.sympathy #{viewHelper.formatNumberByThousands(post.getSympathyCount())} 8 | img.borderless(src="/images/dislike_min.png") 9 | -------------------------------------------------------------------------------- /src/main/resources/templates/posts/index.jade: -------------------------------------------------------------------------------- 1 | .posts-list 2 | 3 | for post in posts 4 | .post-item 5 | a(href="/posts/#{post.getPermalink().length() > 0 ? post.getPermalink() : post.getId()}") 6 | .condensed 7 | h3 #{post.getTitle()} 8 | include ../posts/fragments/socialReadonly 9 | .meta 10 | span #{viewHelper.getFormattedDate(post.getCreatedAt())} 11 | 12 | include fragments/paginator -------------------------------------------------------------------------------- /src/main/resources/templates/posts/projects.jade: -------------------------------------------------------------------------------- 1 | extends ../layout/app 2 | 3 | block content 4 | p Under construction -------------------------------------------------------------------------------- /src/main/resources/templates/tags/index.jade: -------------------------------------------------------------------------------- 1 | extends ../layout/app 2 | 3 | block title 4 | | Tags 5 | 6 | block page_title 7 | h1 Tags 8 | 9 | block content 10 | .post 11 | .content 12 | ul.tags 13 | for tag in tags 14 | li: a.btn.btn-default(href="/tags/#{tag[0]}") #{tag[0]}(#{tag[1]}) 15 | -------------------------------------------------------------------------------- /src/main/resources/templates/tags/show.jade: -------------------------------------------------------------------------------- 1 | extends ../layout/app 2 | 3 | block title 4 | = viewHelper.metaTitle(tag.getName()) 5 | 6 | block page_title 7 | h1 Tag #{tag.getName()} 8 | 9 | block content 10 | include ../posts/index -------------------------------------------------------------------------------- /src/main/resources/templates/users/signin.jade: -------------------------------------------------------------------------------- 1 | extends ../layout/app 2 | 3 | block page_title 4 | h1 Admin Signin 5 | 6 | block content 7 | .row 8 | .col-md-4.col-md-offset-4.login-container 9 | .login-panel 10 | form.signin-form(method="post",action="/authenticate") 11 | input(type="hidden", name='_csrf', value='#{_csrf.token}') 12 | input.form-control(type="text",name="username",placeholder="Email") 13 | input.form-control(type="password",name="password",placeholder="Password") 14 | div.col-centered(style="padding-top: 10px;") 15 | input(type="checkbox",name="remember-me") 16 | span(style="padding-left: 10px") 17 | | remember me 18 | button.btn.btn-primary.btn-block(type="submit") Login 19 | 20 | --------------------------------------------------------------------------------