dist/smart-area.js
function highlightText(){
                var text = $scope.areaData,
                    html = htmlEncode(text);

                if(typeof($scope.areaConfig.autocomplete) === 'undefined' || $scope.areaConfig.autocomplete.length === 0){
                    return;
                }

                $scope.areaConfig.autocomplete.forEach(function(autoList){
                    for(var i=0; i<autoList.words.length; i++){
                        if(typeof(autoList.words[i]) === "string"){
                            html = html.replace(new RegExp("([^\\w]|\\b)("+autoList.words[i]+")([^\\w]|\\b)", 'g'), '$1<span class="'+autoList.cssClass+'">$2</span>$3');
                        }else{
                            html = html.replace(autoList.words[i], function(match){
                                return '<span class="'+autoList.cssClass+'">'+match+'</span>';
                            });
                        }
                    }
                });
                // Add to the fakeArea
                $scope.fakeArea = $sce.trustAsHtml(html);
            }
function highlightText(){
                var text = $scope.areaData,
                    html = htmlEncode(text);

                if(typeof($scope.areaConfig.autocomplete) === 'undefined' || $scope.areaConfig.autocomplete.length === 0){
                    return;
                }

                $scope.areaConfig.autocomplete.forEach(function(autoList){
                    for(var i=0; i<autoList.words.length; i++){
                        if(typeof(autoList.words[i]) === "string"){
                            html = html.replace(new RegExp("([^\\w]|\\b)("+autoList.words[i]+")([^\\w]|\\b)", 'g'), '$1<span class="'+autoList.cssClass+'">$2</span>$3');
                        }else{
                            html = html.replace(autoList.words[i], function(match){
                                return '<span class="'+autoList.cssClass+'">'+match+'</span>';
                            });
                        }
                    }
                });
                // Add to the fakeArea
                $scope.fakeArea = $sce.trustAsHtml(html);
            }
function highlightText ( ) { var text = $scope . areaData , html = htmlEncode ( text ) ; if ( typeof ( $scope . areaConfig . autocomplete ) === 'undefined' || $scope . areaConfig . autocomplete . length === 0 ) { return ; } $scope . areaConfig . autocomplete . forEach ( function ( autoList ) { for ( var i = 0 ; i < autoList . words . length ; i ++ ) { if ( typeof ( autoList . words [ i ] ) === "string" ) { html = html . replace ( new RegExp ( "([^\\w]|\\b)(" + autoList . words [ i ] + ")([^\\w]|\\b)" , 'g' ) , '$1<span class="' + autoList . cssClass + '">$2</span>$3' ) ; } else { html = html . replace ( autoList . words [ i ] , function ( match ) { return '<span class="' + autoList . cssClass + '">' + match + '</span>' ; } ) ; } } } ) ; // Add to the fakeArea $scope . fakeArea = $sce . trustAsHtml ( html ) ; }
Perform the "syntax" highlighting of autocomplete words that have
a cssClass specified.
Perform the syntax highlighting of autocomplete words that have a cssClass specified .