mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Bump marked
This commit is contained in:
parent
77ea8bd6c6
commit
7cf64c75a5
8 changed files with 26 additions and 40 deletions
|
@ -82,6 +82,7 @@
|
|||
"angular-bootstrap-colorpicker": "3.0.19",
|
||||
"angular-elastic": "2.5.0",
|
||||
"angular-route": "1.4.7",
|
||||
"angular-sanitize": "1.5.7",
|
||||
"ansicolors": "0.3.2",
|
||||
"autoprefixer": "5.1.1",
|
||||
"autoprefixer-loader": "2.0.0",
|
||||
|
@ -127,7 +128,7 @@
|
|||
"less": "2.5.1",
|
||||
"less-loader": "2.2.0",
|
||||
"lodash": "3.10.1",
|
||||
"marked": "0.3.3",
|
||||
"marked": "0.3.5",
|
||||
"minimatch": "2.0.10",
|
||||
"mkdirp": "0.5.1",
|
||||
"moment": "2.13.0",
|
||||
|
@ -178,7 +179,6 @@
|
|||
"grunt-simple-mocha": "0.4.0",
|
||||
"gruntify-eslint": "1.0.1",
|
||||
"handlebars": "4.0.5",
|
||||
"html-entities": "1.1.3",
|
||||
"husky": "0.8.1",
|
||||
"image-diff": "1.6.0",
|
||||
"intern": "3.2.3",
|
||||
|
@ -193,7 +193,6 @@
|
|||
"license-checker": "3.1.0",
|
||||
"load-grunt-config": "0.19.1",
|
||||
"makelogs": "3.0.2",
|
||||
"marked-text-renderer": "0.1.0",
|
||||
"mocha": "2.3.0",
|
||||
"ncp": "2.0.0",
|
||||
"nock": "2.10.0",
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
import marked from 'marked';
|
||||
import uiModules from 'ui/modules';
|
||||
import 'angular-sanitize';
|
||||
|
||||
marked.setOptions({
|
||||
gfm: true, // Github-flavored markdown
|
||||
sanitize: true // Sanitize HTML tags
|
||||
});
|
||||
|
||||
const module = uiModules.get('kibana/markdown_vis', ['kibana']);
|
||||
module.controller('KbnMarkdownVisController', function ($scope, $sce) {
|
||||
|
||||
const module = uiModules.get('kibana/markdown_vis', ['kibana', 'ngSanitize']);
|
||||
module.controller('KbnMarkdownVisController', function ($scope) {
|
||||
$scope.$watch('vis.params.markdown', function (html) {
|
||||
if (!html) return;
|
||||
$scope.html = $sce.trustAsHtml(marked(html));
|
||||
$scope.html = marked(html);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<span ng-if="!isHtml">{{content}}</span>
|
||||
<span ng-if="isHtml" ng-bind-html="content | trustAsHtml"></span>
|
||||
<span ng-if="isHtml" ng-bind-html="content"></span>
|
||||
<span ng-if="truncated">
|
||||
<a ng-click="toggle()">{{action}}</a>
|
||||
</span>
|
||||
|
|
|
@ -3,8 +3,9 @@ import truncText from 'trunc-text';
|
|||
import truncHTML from 'trunc-html';
|
||||
import uiModules from 'ui/modules';
|
||||
import truncatedTemplate from 'ui/directives/partials/truncated.html';
|
||||
import 'ui/filters/trust_as_html';
|
||||
const module = uiModules.get('kibana');
|
||||
import 'angular-sanitize';
|
||||
|
||||
const module = uiModules.get('kibana', ['ngSanitize']);
|
||||
|
||||
module.directive('kbnTruncated', function ($compile) {
|
||||
return {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import marked from 'marked';
|
||||
import uiModules from 'ui/modules';
|
||||
import 'angular-sanitize';
|
||||
|
||||
marked.setOptions({
|
||||
gfm: true, // GitHub-flavored markdown
|
||||
|
@ -7,7 +8,7 @@ marked.setOptions({
|
|||
});
|
||||
|
||||
uiModules
|
||||
.get('kibana')
|
||||
.filter('markdown', function ($sce) {
|
||||
return md => md ? $sce.trustAsHtml(marked(md)) : '';
|
||||
.get('kibana', ['ngSanitize'])
|
||||
.filter('markdown', function ($sanitize) {
|
||||
return md => md ? $sanitize(marked(md)) : '';
|
||||
});
|
||||
|
|
|
@ -11,14 +11,14 @@ import VislibVisualizationsMarkerTypesScaledCirclesProvider from 'ui/vislib/visu
|
|||
import VislibVisualizationsMarkerTypesShadedCirclesProvider from 'ui/vislib/visualizations/marker_types/shaded_circles';
|
||||
import VislibVisualizationsMarkerTypesGeohashGridProvider from 'ui/vislib/visualizations/marker_types/geohash_grid';
|
||||
import VislibVisualizationsMarkerTypesHeatmapProvider from 'ui/vislib/visualizations/marker_types/heatmap';
|
||||
export default function MapFactory(Private, tilemap) {
|
||||
export default function MapFactory(Private, tilemap, $sanitize) {
|
||||
|
||||
let defaultMapZoom = 2;
|
||||
let defaultMapCenter = [15, 5];
|
||||
let defaultMarkerType = 'Scaled Circle Markers';
|
||||
|
||||
let tilemapOptions = tilemap.options;
|
||||
let attribution = marked(tilemapOptions.attribution);
|
||||
let attribution = $sanitize(marked(tilemapOptions.attribution));
|
||||
|
||||
let mapTiles = {
|
||||
url: tilemap.url,
|
||||
|
|
|
@ -6,8 +6,10 @@ import _ from 'lodash';
|
|||
import RegistryVisTypesProvider from 'ui/registry/vis_types';
|
||||
import uiModules from 'ui/modules';
|
||||
import visualizeTemplate from 'ui/visualize/visualize.html';
|
||||
import 'angular-sanitize';
|
||||
|
||||
uiModules
|
||||
.get('kibana/directive')
|
||||
.get('kibana/directive', ['ngSanitize'])
|
||||
.directive('visualize', function (Notifier, SavedVis, indexPatterns, Private, config, $timeout) {
|
||||
|
||||
|
||||
|
|
|
@ -1,37 +1,17 @@
|
|||
let marked = require('marked');
|
||||
let Promise = require('bluebird');
|
||||
let { join } = require('path');
|
||||
let TextRenderer = require('marked-text-renderer');
|
||||
let _ = require('lodash');
|
||||
let fs = require('fs');
|
||||
let { AllHtmlEntities } = require('html-entities');
|
||||
let entities = new AllHtmlEntities();
|
||||
|
||||
TextRenderer.prototype.heading = function (text, level, raw) {
|
||||
return '\n\n' + text + '\n' + _.map(text, function () { return '='; }).join('') + '\n';
|
||||
};
|
||||
|
||||
module.exports = function (grunt) {
|
||||
|
||||
grunt.registerTask('_build:readme', function () {
|
||||
let transform = function (input) {
|
||||
let output = input.replace(/<\!\-\- [^\-]+ \-\->/g, '\n');
|
||||
output = marked(output);
|
||||
return entities.decode(output);
|
||||
};
|
||||
function transformReadme(readme) {
|
||||
return readme.replace(/\s##\sSnapshot\sBuilds[\s\S]*/, '');
|
||||
}
|
||||
|
||||
marked.setOptions({
|
||||
renderer: new TextRenderer(),
|
||||
tables: true,
|
||||
breaks: false,
|
||||
pedantic: false,
|
||||
sanitize: false,
|
||||
smartLists: true,
|
||||
smartypants: false
|
||||
});
|
||||
|
||||
grunt.file.write('build/kibana/README.txt', transform(grunt.file.read('README.md')));
|
||||
grunt.file.write('build/kibana/LICENSE.txt', transform(grunt.file.read('LICENSE.md')));
|
||||
grunt.file.copy('LICENSE.md', 'build/kibana/LICENSE.txt');
|
||||
grunt.file.write('build/kibana/README.txt', transformReadme(grunt.file.read('README.md')));
|
||||
});
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue