mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-02 11:54:15 +01:00
#2732 Regression fixes for accessibility
This commit is contained in:
@@ -69,7 +69,7 @@ line
|
||||
statement
|
||||
:
|
||||
| txt value { yy.addSection($1,yy.cleanupValue($2)); }
|
||||
| title title_value { $$=$2.trim();yy.setTitle($$); }
|
||||
| title title_value { $$=$2.trim();yy.setPieTitle($$); }
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setTitle($$); }
|
||||
| acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }
|
||||
| acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); } | section {yy.addSection($1.substr(8));$$=$1.substr(8);}
|
||||
|
||||
@@ -52,6 +52,15 @@ const clear = function () {
|
||||
commonClear();
|
||||
};
|
||||
|
||||
export const setPieTitle = function (txt) {
|
||||
let sanitizedText = common.sanitizeText(txt, configApi.getConfig());
|
||||
title = sanitizedText;
|
||||
};
|
||||
|
||||
export const getPieTitle = function () {
|
||||
return title;
|
||||
};
|
||||
|
||||
export default {
|
||||
parseDirective,
|
||||
getConfig: () => configApi.getConfig().pie,
|
||||
@@ -61,6 +70,8 @@ export default {
|
||||
clear,
|
||||
setTitle,
|
||||
getTitle,
|
||||
setPieTitle,
|
||||
getPieTitle,
|
||||
setShowData,
|
||||
getShowData,
|
||||
getAccDescription,
|
||||
|
||||
@@ -136,7 +136,7 @@ export const draw = (txt, id) => {
|
||||
|
||||
svg
|
||||
.append('text')
|
||||
.text(parser.yy.getTitle())
|
||||
.text(parser.yy.getPieTitle())
|
||||
.attr('x', 0)
|
||||
.attr('y', -(height - 50) / 2)
|
||||
.attr('class', 'pieTitleText');
|
||||
|
||||
Reference in New Issue
Block a user