File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
hypha/static_src/javascript Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 22 // Select all rich text answers.
33 const richtextanswers = document . querySelector ( ".rich-text--answers" ) ;
44
5- // Remove p tags with only whitespace inside .
5+ // Select all rich text answers paragraphes .
66 const richtextanswers_paras = richtextanswers . querySelectorAll ( "p" ) ;
77 richtextanswers_paras . forEach ( function ( para ) {
8+ // Remove p tags with only whitespace inside.
89 if ( para . textContent . trim ( ) === "" ) {
910 para . remove ( ) ;
1011 }
12+ // Set dir="auto" so browsers sets the correct directionality (ltr/rtl).
13+ para . setAttribute ( 'dir' , 'auto' ) ;
1114 } ) ;
1215
13- // Wrap all tables in a div so overflow auto works .
16+ // Select all rich text answers tables .
1417 const richtextanswers_tables = richtextanswers . querySelectorAll ( "table" ) ;
18+ // Wrap all tables in a div so overflow auto works.
1519 richtextanswers_tables . forEach ( function ( table ) {
1620 const table_wrapper = document . createElement ( "div" ) ;
1721 table_wrapper . classList . add ( "rich-text__table" ) ;
You can’t perform that action at this time.
0 commit comments