BBCode::Internal_CleanupWSByPoppingStack( $pattern, $array )
Description
Source
File: bp-forums/admin/parser.php
1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 | function Internal_CleanupWSByPoppingStack( $pattern , & $array ) { if ( strlen ( $pattern ) <= 0) return ; $oldlen = count ( $array ); foreach ( str_split ( $pattern ) as $char ) { switch ( $char ) { case 's' : while ( count ( $array ) > 0 && $array [ count ( $array )-1][BBCODE_STACK_TOKEN] == BBCODE_WS) array_pop ( $array ); break ; case 'n' : if ( count ( $array ) > 0 && $array [ count ( $array )-1][BBCODE_STACK_TOKEN] == BBCODE_NL) array_pop ( $array ); break ; case 'a' : while ( count ( $array ) > 0 && (( $token = $array [ count ( $array )-1][BBCODE_STACK_TOKEN]) == BBCODE_WS || $token == BBCODE_NL)) array_pop ( $array ); break ; } } if ( count ( $array ) != $oldlen ) { $this ->Internal_ComputeCurrentClass(); } } |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.